package Project;
//___________________________IMPORTACIONES______________________________________

import Validaciones.*;
import com.toedter.calendar.*;
import java.awt.*;
import java.io.*;
import java.sql.*;
import java.text.*;
import java.util.logging.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.filechooser.*;
import javax.swing.table.*;
//______________________________________________________________________________

public class IngresarAccidente extends javax.swing.JPanel {
//_____________________________ATRIBUTOS________________________________________

    private IniciarReporte jasper;
    String Descripcion;
    String sql;
    int Limite = 500;
    int Dialog;
    int Contador;
    int Cont;
    DefaultListModel modelo;
    String name = "";
    int seleccion;
    String caso = "";
//_____________________________CONSTRUCTOR______________________________________

    public IngresarAccidente() {
        initComponents();
        rbtnCerrado.setSelected(true);
        modelo = new DefaultListModel();
        lstAdjuntos.setModel(modelo);
        fecha();
        ocultar();
    }
//________________________________METODOS_______________________________________

    private void ocultar() {
        ((JTextFieldDateEditor) dcFecha.getDateEditor()).setEditable(false);
        ((JTextFieldDateEditor) dcFecha.getDateEditor()).setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        String a = Container.lblPrivilegio.getText();
        if (a.equals("3")) {
            for (int i = 0; i < jPanel1.getComponents().length; i++) {
                jPanel1.getComponent(i).setEnabled(false);
            }
            btnVerTabla.setEnabled(true);
            btnmodificar.setEnabled(false);
            btnEliminar.setEnabled(false);
        }
        dcFechaAccidente.setVisible(false);
        lblIdTipoAccidente.setVisible(false);
        lblIdGrado.setVisible(false);
        lblIdRuta.setVisible(false);
        lblIdConductor.setVisible(false);
        lblDescripcion.setVisible(false);
        lblFecha.setVisible(false);
        lblIdAccidentes.setVisible(false);
        txtLesionados.setEnabled(false);
        txtMuertos.setEnabled(false);
        lblIdAccidente.setVisible(false);
        jasper = new IniciarReporte();
    }
//______________________________________________________________________________

    private void llamarDialog() {

        dlgDescripcion.setLocationRelativeTo(null);
        dlgDescripcion.setVisible(true);

    }

//______________________________________________________________________________
    private void pasarTexto() {

        Descripcion = txtDescripcion.getText();

        if (Descripcion.equals("") || String.valueOf(txtDescripcion.getText().charAt(0)).equals(" ")) {
            JOptionPane.showMessageDialog(dlgDescripcion, "Escriba una descripción valida", "Error", JOptionPane.ERROR_MESSAGE);
        } else {
            JOptionPane.showMessageDialog(dlgDescripcion, "Descripción Guardada");
            btnDescripcion.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
            lblDescripcion.setText(Descripcion);
            dlgDescripcion.setVisible(false);
        }

    }
//______________________________________________________________________________

    public boolean guardarDocumento(int id, String name, String ruta) {
        FileInputStream fis = null;
        try {
            File file = new File(ruta);
            fis = new FileInputStream(file);
            PreparedStatement pstm = BaseDeDatos.con.prepareStatement("INSERT into "
                    + " documentos(id_accidente, nombre, binario) " + " VALUES(?,?,?)");
            pstm.setInt(1, id);
            pstm.setString(2, name);
            pstm.setBinaryStream(3, fis, (int) file.length());
            pstm.execute();
            pstm.close();
            return true;
        } catch (FileNotFoundException | SQLException e) {
            System.out.println(e.getMessage());
        } finally {
            try {
                fis.close();
            } catch (IOException e) {
                System.out.println(e.getMessage());
            }
        }
        return false;
    }
//______________________________________________________________________________

    private void Actualizar_documentos(int indice) {
        this.modelo.clear();
        this.modelo = Lista_Imagenes(indice);
        this.lstDocumentos.setModel(modelo);
    }
//______________________________________________________________________________

    private void Actualizar_lista(int indice) {
        this.modelo.clear();
        this.modelo = Lista_Imagenes(indice);
        this.lstAdjuntos.setModel(modelo);
    }

//______________________________________________________________________________    
    public DefaultListModel Lista_Imagenes(int num) {
        ResultSet resultSet = null;
        DefaultListModel dml = new DefaultListModel();
        try {
            resultSet = BaseDeDatos.stmt.executeQuery("SELECT nombre FROM documentos where id_accidente =" + num);
            while (resultSet.next()) {
                dml.addElement(resultSet.getString("nombre"));
                try {
                } catch (Exception ex) {
                    System.err.println(ex.getMessage());
                }
            }
        } catch (SQLException ex) {
            System.err.println(ex.getMessage());
        }
        return dml;
    }
//______________________________________________________________________________

    private void ocultarColumnas() {
        int i;
        for (i = 12; i < 17; i++) {
            tablaAccidentes.getColumnModel().getColumn(i).setMaxWidth(0);
            tablaAccidentes.getColumnModel().getColumn(i).setMinWidth(0);
            tablaAccidentes.getColumnModel().getColumn(i).setPreferredWidth(0);
            tablaAccidentes.getColumnModel().getColumn(i).setResizable(false);
        }
    }
//______________________________________________________________________________

    private void tamanoAccidente() {

        int ancho = 1000;
        int anchoColumna = 0;
        TableColumnModel modeloColumna = tablaAccidentes.getColumnModel();
        TableColumn columnaTabla;
        for (int i = 0; i < tablaAccidentes.getColumnCount(); i++) {
            columnaTabla = modeloColumna.getColumn(i);
            switch (i) {
                case 0:
                    anchoColumna = (10 * ancho) / 100;
                    break;
                case 1:
                    anchoColumna = (20 * ancho) / 100;
                    break;
                case 2:
                    anchoColumna = (25 * ancho) / 100;
                    break;
                case 3:
                    anchoColumna = (20 * ancho) / 100;
                    break;
                case 4:
                    anchoColumna = (10 * ancho) / 100;
                    break;
                case 5:
                    anchoColumna = (10 * ancho) / 100;
                    break;
                case 6:
                    anchoColumna = (10 * ancho) / 100;
                    break;
                case 7:
                    anchoColumna = (10 * ancho) / 100;
                    break;
                case 8:
                    anchoColumna = (20 * ancho) / 100;
                    break;
                case 9:
                    anchoColumna = (10 * ancho) / 100;
                    break;
                case 10:
                    anchoColumna = (10 * ancho) / 100;
                    break;
                case 11:
                    anchoColumna = (50 * ancho) / 100;
                    break;
            }
            columnaTabla.setPreferredWidth(anchoColumna);
        }
    }
//______________________________________________________________________________

    private void llenarAccidentes(String Valor) {

        BaseDeDatos.conectarse();

        try {

            String consulta = "SELECT tipo_accidente.tipo_accidente, grado.grado, ruta.ruta, accidente.lugar, accidente.hora, accidente.fecha, accidente.lesionados,"
                    + " accidente.muertos, conductor.nombre_completo, accidente.vehiculo_placa, accidente.caso, accidente.descripcion, accidente.id, tipo_accidente.id, grado.id, conductor.cedula, ruta.id"
                    + " AS accidente FROM accidente JOIN tipo_accidente ON (tipo_accidente.id = accidente.tipo_accidente_id) JOIN grado ON"
                    + " (grado.id = accidente.grado_id) JOIN ruta ON (ruta.id = accidente.ruta_id) JOIN conductor ON (conductor.cedula = accidente.ced_conductor)";

            int Valor_dos = cbxFiltrarAccidente.getSelectedIndex();

            if (Valor_dos == 1) {
                sql = consulta + " WHERE TO_CHAR(fecha,'YYYY-MM-DD') = '" + Valor + "' ORDER BY accidente.fecha";
            } else if (Valor_dos == 0) {
                sql = consulta + " WHERE accidente.vehiculo_placa ILIKE '" + Valor + "%' ORDER BY accidente.vehiculo_placa";
            }

            DefaultTableModel modelo = new DefaultTableModel();
            tablaAccidentes.setModel(modelo);
            modelo.addColumn("TIPO");
            modelo.addColumn("GRADO");
            modelo.addColumn("RUTA");
            modelo.addColumn("LUGAR");
            modelo.addColumn("HORA");
            modelo.addColumn("FECHA");
            modelo.addColumn("LESIONADOS");
            modelo.addColumn("MUERTOS");
            modelo.addColumn("CONDUCTOR");
            modelo.addColumn("PLACA");
            modelo.addColumn("ESTADO DEL CASO");
            modelo.addColumn("DESCRIPCION");
            modelo.addColumn("ID ACCIDENTE");
            modelo.addColumn("ID TIPO");
            modelo.addColumn("ID GRADO");
            modelo.addColumn("ID CONDUCTOR");
            modelo.addColumn("ID RUTA");

            Statement s = BaseDeDatos.con.createStatement();
            ResultSet rs = s.executeQuery(sql);

            while (rs.next()) {
                // Se crea un array que será una de las filas de la tabla. 
                Object[] fila = new Object[17]; // Hay 17 columnas en la tabla

                // Se rellena cada posición del array con una de las columnas de la tabla en base de datos.
                for (int i = 0; i < 17; i++) {
                    fila[i] = rs.getObject(i + 1); // El primer indice en rs es el 1, no el cero, por eso se suma 1.
                }
                // Se añade al modelo la fila completa.
                modelo.addRow(fila);
            }
            BaseDeDatos.desconectarse();
            tablaAccidentes.setModel(modelo);
            tamanoAccidente();
            ocultarColumnas();
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, ex.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
        }

    }
//______________________________________________________________________________

    private void llenarRutas() {

        BaseDeDatos.conectarse();

        try {

            sql = "select * from ruta order by id";

            DefaultTableModel modelo = new DefaultTableModel();
            tablaRutas.setModel(modelo);
            modelo.addColumn("ID");
            modelo.addColumn("RUTAS");

            Statement s = BaseDeDatos.con.createStatement();
            ResultSet rs = s.executeQuery(sql);

            while (rs.next()) {
                // Se crea un array que será una de las filas de la tabla. 
                Object[] fila = new Object[2]; // Hay 2 columnas en la tabla

                // Se rellena cada posición del array con una de las columnas de la tabla en base de datos.
                for (int i = 0; i < 2; i++) {
                    fila[i] = rs.getObject(i + 1); // El primer indice en rs es el 1, no el cero, por eso se suma 1.
                }
                // Se añade al modelo la fila completa.
                modelo.addRow(fila);
            }
            BaseDeDatos.desconectarse();
            tablaRutas.setModel(modelo);
            tamanoRutas();
            tablaRutas.getColumnModel().getColumn(0).setMaxWidth(0);
            tablaRutas.getColumnModel().getColumn(0).setMinWidth(0);
            tablaRutas.getColumnModel().getColumn(0).setPreferredWidth(0);
            tablaRutas.getColumnModel().getColumn(0).setResizable(false);
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, ex.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
        }

    }
//______________________________________________________________________________

    private void tamanoVehiculo() {

        int ancho = 810;
        int anchoColumna = 0;
        TableColumnModel modeloColumna = tablaVehiculo.getColumnModel();
        TableColumn columnaTabla;
        for (int i = 0; i < tablaVehiculo.getColumnCount(); i++) {
            columnaTabla = modeloColumna.getColumn(i);
            switch (i) {
                case 0:
                    anchoColumna = (30 * ancho) / 100;
                    break;
                case 1:
                    anchoColumna = (30 * ancho) / 100;
                    break;
            }
            columnaTabla.setPreferredWidth(anchoColumna);
        }
    }
//______________________________________________________________________________

    private void tamanoRutas() {

        int ancho = 489;
        int anchoColumna = 0;
        TableColumnModel modeloColumna = tablaRutas.getColumnModel();
        TableColumn columnaTabla;
        for (int i = 0; i < tablaRutas.getColumnCount(); i++) {
            columnaTabla = modeloColumna.getColumn(i);
            switch (i) {
                case 0:
                    anchoColumna = (0 * ancho) / 100;
                    break;
                case 1:
                    anchoColumna = (100 * ancho) / 100;
                    break;
            }
            columnaTabla.setPreferredWidth(anchoColumna);
        }

    }
//______________________________________________________________________________

    private void tamanoConductor() {

        int ancho = 816;
        int anchoColumna = 0;
        TableColumnModel modeloColumna = tablaConductor.getColumnModel();
        TableColumn columnaTabla;
        for (int i = 0; i < tablaConductor.getColumnCount(); i++) {
            columnaTabla = modeloColumna.getColumn(i);
            switch (i) {
                case 0:
                    anchoColumna = (30 * ancho) / 100;
                    break;
                case 1:
                    anchoColumna = (30 * ancho) / 100;
                    break;
            }
            columnaTabla.setPreferredWidth(anchoColumna);
        }

    }
//______________________________________________________________________________

    private void llenarConductores(String Valor) {

        BaseDeDatos.conectarse();

        try {

            int valor_dos = cbxFiltrarConductor.getSelectedIndex();

            if (valor_dos == 0) {
                sql = "SELECT nombre_completo, cedula FROM conductor WHERE nombre_completo ILIKE '" + Valor + "%' ORDER BY nombre_completo";
            } else if (valor_dos == 1) {
                sql = "SELECT nombre_completo, cedula FROM conductor WHERE CAST(cedula AS CHAR(15)) LIKE '" + Valor + "%' order by nombre_completo";
            }

            DefaultTableModel modelo = new DefaultTableModel();
            tablaConductor.setModel(modelo);
            modelo.addColumn("NOMBRE");
            modelo.addColumn("CEDULA");

            Statement s = BaseDeDatos.con.createStatement();
            ResultSet rs = s.executeQuery(sql);

            while (rs.next()) {
                // Se crea un array que será una de las filas de la tabla. 
                Object[] fila = new Object[2]; // Hay 2 columnas en la tabla

                // Se rellena cada posición del array con una de las columnas de la tabla en base de datos.
                for (int i = 0; i < 2; i++) {
                    fila[i] = rs.getObject(i + 1); // El primer indice en rs es el 1, no el cero, por eso se suma 1.
                }
                // Se añade al modelo la fila completa.
                modelo.addRow(fila);
            }
            BaseDeDatos.desconectarse();
            tablaConductor.setModel(modelo);
            tamanoConductor();
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, ex.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
        }

    }
//______________________________________________________________________________

    private void llenarVehiculo(String Valor) {

        BaseDeDatos.conectarse();

        try {

            String consulta = "SELECT placa, num_interno FROM vehiculo";

            int valor_dos = cbxFiltrarVehiculo.getSelectedIndex();

            if (valor_dos == 0) {
                sql = consulta + " WHERE placa ILIKE '" + Valor + "%' ORDER BY placa";
            } else if (valor_dos == 1) {
                sql = consulta + " WHERE CAST(num_interno AS CHAR(3)) LIKE '" + Valor + "%' ORDER BY placa";
            }

            DefaultTableModel modelo = new DefaultTableModel();
            tablaVehiculo.setModel(modelo);
            modelo.addColumn("PLACA");
            modelo.addColumn("NUMERO INTERNO");

            Statement s = BaseDeDatos.con.createStatement();
            ResultSet rs = s.executeQuery(sql);

            while (rs.next()) {
                // Se crea un array que será una de las filas de la tabla. 
                Object[] fila = new Object[2]; // Hay 2 columnas en la tabla

                // Se rellena cada posición del array con una de las columnas de la tabla en base de datos.
                for (int i = 0; i < 2; i++) {
                    fila[i] = rs.getObject(i + 1); // El primer indice en rs es el 1, no el cero, por eso se suma 1.
                }
                // Se añade al modelo la fila completa.
                modelo.addRow(fila);
            }
            BaseDeDatos.desconectarse();
            tablaVehiculo.setModel(modelo);
            tamanoVehiculo();
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, ex.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
        }
    }
//______________________________________________________________________________

    private void masIngresarAccidentes() {
        System.out.println(sql);
        lblIdTipoAccidente.setText("");
        cbxTipo.setSelectedIndex(0);
        lblIdGrado.setText("");
        cbxGrado.setSelectedIndex(0);
        lblIdRuta.setText("");
        txtRuta.setText("");
        txtLugar.setText("");
        txtHora.setText("");
        lblFecha.setText("");
        dcFecha.setDate(null);
        txtLesionados.setText("");
        txtMuertos.setText("");
        lblIdConductor.setText("");
        txtConductor.setText("");
        txtVehiculo.setText("");
        lblDescripcion.setText("");
        ValidacionesAccidentes.pintarNegro(txtRuta);
        ValidacionesAccidentes.pintarNegro(txtLugar);
        ValidacionesAccidentes.pintarNegro(txtHora);
        ValidacionesAccidentes.pintarNegro(txtLesionados);
        ValidacionesAccidentes.pintarNegro(txtMuertos);
        ValidacionesAccidentes.pintarNegro(txtConductor);
        ValidacionesAccidentes.pintarNegro(txtVehiculo);
        ValidacionesAccidentes.pintarNegro(btnDescripcion);
        ValidacionesAccidentes.pintarNegro(((JTextFieldDateEditor) dcFecha.getDateEditor()));
        txtDescripcion.setText("");
    }
//______________________________________________________________________________

    private void ingresarAccidente() {

        BaseDeDatos.conectarse();
        Dialog = JOptionPane.showConfirmDialog(null, "Esta seguro de ingresar este nuevo registro",
                "Advertencia", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
        if (Dialog == JOptionPane.YES_NO_OPTION) {
            try {

                String l, h, r, p, g, i, e, f, j, a, b, insert, insertDoc;

                l = lblIdTipoAccidente.getText();
                h = lblIdGrado.getText();
                r = lblIdRuta.getText();
                p = txtLugar.getText();
                g = txtHora.getText();
                i = lblFecha.getText();
                e = txtLesionados.getText();
                f = txtMuertos.getText();
                j = lblIdConductor.getText();
                a = txtVehiculo.getText();
                b = lblDescripcion.getText();

                insertDoc = "insert into documentos (id_accidente, nombre, binario)";
                insert = "insert into accidente (tipo_accidente_id, grado_id, ruta_id, lugar, hora, fecha, lesionados, muertos,"
                        + " ced_conductor, vehiculo_placa, descripcion, caso) values (" + l + "," + h + "," + r + ",'" + p + "',"
                        + "'" + g + "','" + i + "'," + e + "," + f + "," + j + ",'" + a + "','" + b + "','" + caso + "')";

                if (lstAdjuntos.getModel().getSize() == 0) {//lista vacia

                    sql = "" + insert;
                    int resultado = BaseDeDatos.stmt.executeUpdate(sql);
                    if (resultado == 1) {
                        JOptionPane.showMessageDialog(null, "El registro se agrego de manera exitosa", "Info", JOptionPane.INFORMATION_MESSAGE);
                        masIngresarAccidentes();
                    }

                } else {

                    sql = "" + insert;
                    int resultado = BaseDeDatos.stmt.executeUpdate(sql);

                    //guardarfoto(m);
                    if (resultado == 1) {
                        JOptionPane.showMessageDialog(null, "El registro se agrego de manera exitosa", "Info", JOptionPane.INFORMATION_MESSAGE);
                        masIngresarAccidentes();
                    }

                }

            } catch (SQLException | HeadlessException e) {
                JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
            }
        }
        BaseDeDatos.desconectarse();
        llenarAccidentes("");
    }
//______________________________________________________________________________

    private void eliminarAccidente() {

        BaseDeDatos.conectarse();

        if (tablaAccidentes.getSelectedRows().length < 1) {
            JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
        } else if (JOptionPane.showConfirmDialog(null, "Esta seguro de que desea eliminar este registro",
                "Advertencia", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_NO_OPTION) {
            try {

                lblIdAccidentes.setText("" + tablaAccidentes.getValueAt(tablaAccidentes.getSelectedRow(), 12));
                String d = lblIdAccidentes.getText();
                sql = "delete  from accidente where id=" + d;
                int resultado = BaseDeDatos.stmt.executeUpdate(sql);
                if (resultado == 1) {
                    JOptionPane.showMessageDialog(null, "El registro a sido eliminado", "Info", JOptionPane.INFORMATION_MESSAGE);
                }

            } catch (SQLException | HeadlessException e) {
                JOptionPane.showMessageDialog(null, "El registro no se pudo borrar", "Error", JOptionPane.ERROR_MESSAGE);
            }
        }
        BaseDeDatos.desconectarse();
        llenarAccidentes("");
    }
//______________________________________________________________________________

    private void ClearModificarAccidente() {
        modelo.clear();
        lblIdTipoAccidente.setText("");
        cbxNuevoTipo.setSelectedIndex(0);
        lblIdGrado.setText("");
        cbxNuevoGrado.setSelectedIndex(0);
        lblIdRuta.setText("");
        txtNuevaRuta.setText("");
        txtNuevoLugar.setText("");
        txtNuevaHora.setText("");
        lblFecha.setText("");
        dcNuevaFecha.setDate(null);
        txtNuevosLesionados.setText("");
        txtNuevosMuertos.setText("");
        lblIdConductor.setText("");
        txtNuevoConductor.setText("");
        txtNuevoVehiculo.setText("");
        lblDescripcion.setText("");
        txtDescripcion.setText("");
        lblCaso.setText("");
        ValidacionesAccidentes.pintarNegro(cbxNuevoTipo);
        ValidacionesAccidentes.pintarNegro(cbxNuevoGrado);
        ValidacionesAccidentes.pintarNegro(txtNuevaRuta);
        ValidacionesAccidentes.pintarNegro(txtNuevoLugar);
        ValidacionesAccidentes.pintarNegro(txtNuevaHora);
        ValidacionesAccidentes.pintarNegro(((JTextFieldDateEditor) dcNuevaFecha.getDateEditor()));
        ValidacionesAccidentes.pintarNegro(txtNuevosLesionados);
        ValidacionesAccidentes.pintarNegro(txtNuevosMuertos);
        ValidacionesAccidentes.pintarNegro(txtNuevoConductor);
        ValidacionesAccidentes.pintarNegro(txtNuevoVehiculo);
        ValidacionesAccidentes.pintarNegro(btnNuevaDescripcion);
        dlgModificar.setVisible(false);
    }
//______________________________________________________________________________

    private void modificarAccidente() {

        BaseDeDatos.conectarse();

        if (JOptionPane.showConfirmDialog(null, "Esta seguro de que desea modificar este registro",
                "Advertencia", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_NO_OPTION) {
            try {

                String a, b, c, d, f, g, h, i, j, k, l, n, o, update;
                a = lblIdTipoAccidente.getText();
                b = lblIdGrado.getText();
                c = lblIdRuta.getText();
                d = txtNuevoLugar.getText();
                f = txtNuevaHora.getText();
                g = lblFecha.getText();
                h = txtNuevosLesionados.getText();
                i = txtNuevosMuertos.getText();
                j = lblIdConductor.getText();
                k = txtNuevoVehiculo.getText();
                l = lblDescripcion.getText();
                o = lblIdAccidentes.getText();

                update = "update accidente set tipo_accidente_id=" + a + ", grado_id=" + b + ", ruta_id=" + c + ", lugar='" + d + "', hora='" + f + "', "
                        + "fecha='" + g + "', lesionados=" + h + ", muertos=" + i + ", ced_conductor=" + j + ", vehiculo_placa='" + k + "'"
                        + ", descripcion='" + l + "' where id=" + o + "";

                
                    sql = "" + update;
                    int resultado = BaseDeDatos.stmt.executeUpdate(sql);
                    if (resultado == 1) {
                        JOptionPane.showMessageDialog(null, "El registro ha sido modificado exitosamente", "Info", JOptionPane.INFORMATION_MESSAGE);
                        ClearModificarAccidente();
                    }

            } catch (Exception e) {
                JOptionPane.showMessageDialog(null, "El registro no se pudo  modificar", "Error", JOptionPane.ERROR_MESSAGE);
                System.out.println("Excepcion modificando: " + e.getMessage());
            }
        }
        BaseDeDatos.desconectarse();
        llenarAccidentes("");
    }
//______________________________________________________________________________

    private void fecha() {

        ((JTextFieldDateEditor) dcFechaAccidente.getDateEditor()).addCaretListener(new javax.swing.event.CaretListener() {
            @Override
            public void caretUpdate(javax.swing.event.CaretEvent evt) {
                dcFechaCaretUpdate(evt);
            }

            private void dcFechaCaretUpdate(CaretEvent evt) {
                if (dcFechaAccidente.getDate() != null) {
                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-d");
                    java.util.Date date = dcFechaAccidente.getDate();
                    txtBuscarAccidente.setText(sdf.format(date));
                }
            }
        });

        ((JTextFieldDateEditor) dcNuevaFecha.getDateEditor()).addCaretListener(new javax.swing.event.CaretListener() {
            @Override
            public void caretUpdate(javax.swing.event.CaretEvent evt) {
                dcNuevaFechaCaretUpdate(evt);
            }

            private void dcNuevaFechaCaretUpdate(CaretEvent evt) {
                if (dcNuevaFecha.getDate() != null) {
                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-d");
                    java.util.Date date = dcNuevaFecha.getDate();
                    lblFecha.setText(sdf.format(date));
                }
            }
        });

        ((JTextFieldDateEditor) dcFecha.getDateEditor()).addCaretListener(new javax.swing.event.CaretListener() {
            @Override
            public void caretUpdate(javax.swing.event.CaretEvent evt) {
                dcFechaCaretUpdate(evt);
            }

            private void dcFechaCaretUpdate(CaretEvent evt) {
                if (dcFecha.getDate() != null) {
                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-d");
                    java.util.Date date = dcFecha.getDate();
                    lblFecha.setText(sdf.format(date));
                }
            }
        });
    }

    void llenarList() {
        modelo.clear();
        BaseDeDatos.conectarse();
        try {
            String h = lblIdAccidentes.getText();
            sql = "SELECT nombre FROM documentos where id_accidente =" + h;
            Statement s = BaseDeDatos.con.createStatement();
            ResultSet rs = s.executeQuery(sql);
            while (rs.next()) {
                modelo.addElement(rs.getString("nombre"));
            }
            lstDocumentos.setModel(modelo);

        } catch (SQLException e) {
            e.printStackTrace();
        }
        BaseDeDatos.desconectarse();
    }

//______________________________________________________________________________
    public void btnModificar() {
        ((JTextFieldDateEditor) dcNuevaFecha.getDateEditor()).setEditable(false);
        lblIdGradoModificar.setVisible(false);
        if (tablaAccidentes.getSelectedRows().length < 1) {

            JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);

        } else {

            lblIdTipoAccidente.setText("" + tablaAccidentes.getValueAt(tablaAccidentes.getSelectedRow(), 13));
            int t = Integer.parseInt(lblIdTipoAccidente.getText());
            cbxNuevoTipo.setSelectedIndex(t);

            lblIdGrado.setText("" + tablaAccidentes.getValueAt(tablaAccidentes.getSelectedRow(), 14));
            int g = Integer.parseInt(lblIdGrado.getText());
            cbxNuevoGrado.setSelectedIndex(g);

            txtNuevaRuta.setText("" + tablaAccidentes.getValueAt(tablaAccidentes.getSelectedRow(), 2));
            lblIdRuta.setText("" + tablaAccidentes.getValueAt(tablaAccidentes.getSelectedRow(), 16));
            txtNuevoLugar.setText("" + tablaAccidentes.getValueAt(tablaAccidentes.getSelectedRow(), 3));
            txtNuevaHora.setText("" + tablaAccidentes.getValueAt(tablaAccidentes.getSelectedRow(), 4));

            String Fecha = "" + tablaAccidentes.getValueAt(tablaAccidentes.getSelectedRow(), 5);
            lblFecha.setText(Fecha);
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-d");
            java.util.Date d;

            try {
                d = sdf.parse(Fecha);
                dcNuevaFecha.setDate(d);
            } catch (ParseException ex) {
                Logger.getLogger(IngresarAccidente.class.getName()).log(Level.SEVERE, null, ex);
            }

            txtNuevosLesionados.setText("" + tablaAccidentes.getValueAt(tablaAccidentes.getSelectedRow(), 6));
            txtNuevosMuertos.setText("" + tablaAccidentes.getValueAt(tablaAccidentes.getSelectedRow(), 7));
            txtNuevoConductor.setText("" + tablaAccidentes.getValueAt(tablaAccidentes.getSelectedRow(), 8));
            lblIdConductor.setText("" + tablaAccidentes.getValueAt(tablaAccidentes.getSelectedRow(), 15));
            txtNuevoVehiculo.setText("" + tablaAccidentes.getValueAt(tablaAccidentes.getSelectedRow(), 9));
            lblCaso.setText("" + tablaAccidentes.getValueAt(tablaAccidentes.getSelectedRow(), 10));
            txtDescripcion.setText("" + tablaAccidentes.getValueAt(tablaAccidentes.getSelectedRow(), 11));
            lblDescripcion.setText("" + tablaAccidentes.getValueAt(tablaAccidentes.getSelectedRow(), 11));
            lblIdAccidentes.setText("" + tablaAccidentes.getValueAt(tablaAccidentes.getSelectedRow(), 12));
            if (lblCaso.getText().equals("Abierto")) {
                rbtnCasoAbierto.setSelected(true);
            } else {
                rbtnCasoCerrado.setSelected(true);
            }
            llenarList();
            dlgModificar.setLocationRelativeTo(null);
            dlgModificar.setVisible(true);


        }
    }
//______________________________________________________________________________

    public void btnVersion() {
        if (tablaAccidentes.getSelectedRows().length < 1) {
            JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
        } else {
            rbtnSi.setSelected(true);
            lblCond.setText("" + tablaAccidentes.getValueAt(tablaAccidentes.getSelectedRow(), 8));
            lblCed.setText("" + tablaAccidentes.getValueAt(tablaAccidentes.getSelectedRow(), 15));
            lblFech.setText("" + tablaAccidentes.getValueAt(tablaAccidentes.getSelectedRow(), 5));
            dlgCarta.setLocationRelativeTo(null);
            dlgCarta.setVisible(true);
        }
    }
//______________________________________________________________________________

    public class hiloRutas implements Runnable {

        @Override
        @SuppressWarnings("SleepWhileInLoop")
        public void run() {
            for (int i = 0; i <= 100; i++) {
                try {
                    pbCargarDatos.setValue(i);
                    pbCargarDatos.repaint();
                    Thread.sleep(10);
                    if (pbCargarDatos.getValue() == 1) {
                        llenarRutas();
                    } else if (pbCargarDatos.getValue() == 100) {
                        pbCargarDatos.setValue(0);
                        dlgCargandoDatos.dispose();
                        dlgRuta.setLocationRelativeTo(null);
                        dlgRuta.setVisible(true);
                    }
                } catch (InterruptedException e) {
                    JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
                }
            }
        }
    }
//______________________________________________________________________________

    public class hiloConductores implements Runnable {

        @Override
        @SuppressWarnings("SleepWhileInLoop")
        public void run() {
            for (int i = 0; i <= 100; i++) {
                try {
                    pbCargarDatos.setValue(i);
                    pbCargarDatos.repaint();
                    Thread.sleep(10);
                    if (pbCargarDatos.getValue() == 1) {
                        llenarConductores("");
                    } else if (pbCargarDatos.getValue() == 100) {
                        pbCargarDatos.setValue(0);
                        dlgCargandoDatos.dispose();
                        dlgConductor.setLocationRelativeTo(null);
                        dlgConductor.setVisible(true);
                    }
                } catch (InterruptedException e) {
                    JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
                }
            }
        }
    }
//______________________________________________________________________________

    public class hiloVehiculos implements Runnable {

        @Override
        @SuppressWarnings("SleepWhileInLoop")
        public void run() {
            for (int i = 0; i <= 100; i++) {
                try {
                    pbCargarDatos.setValue(i);
                    pbCargarDatos.repaint();
                    Thread.sleep(10);
                    if (pbCargarDatos.getValue() == 1) {
                        llenarVehiculo("");
                    } else if (pbCargarDatos.getValue() == 100) {
                        pbCargarDatos.setValue(0);
                        dlgCargandoDatos.dispose();
                        dlgVehiculo.setLocationRelativeTo(null);
                        dlgVehiculo.setVisible(true);
                    }
                } catch (InterruptedException e) {
                    JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
                }
            }
        }
    }
//______________________________________________________________________________

    public class hiloAccidentes implements Runnable {

        @Override
        @SuppressWarnings("SleepWhileInLoop")
        public void run() {
            for (int i = 0; i <= 100; i++) {
                try {
                    pbCargarDatos.setValue(i);
                    pbCargarDatos.repaint();
                    Thread.sleep(10);
                    if (pbCargarDatos.getValue() == 1) {
                        llenarAccidentes("");
                    } else if (pbCargarDatos.getValue() == 100) {
                        pbCargarDatos.setValue(0);
                        dlgCargandoDatos.dispose();
                        dlgTablaAccidentes.setLocationRelativeTo(null);
                        dlgTablaAccidentes.setVisible(true);
                    }
                } catch (InterruptedException e) {
                    JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
                }
            }
        }
    }
//______________________________________________________________________________

    public boolean guardarfoto(String ruta) {
        int p = Integer.parseInt(lblIdAccidente.getText());
        FileInputStream fis = null;
        try {
            File file = new File(ruta);
            fis = new FileInputStream(file);
            PreparedStatement pstm = BaseDeDatos.con.prepareStatement("Update accidente Set croquis = ? Where id = " + p);
            pstm.setBinaryStream(1, fis, (int) file.length());
            pstm.execute();
            pstm.close();
            return true;
        } catch (FileNotFoundException | SQLException e) {
            System.out.println(e.getMessage());
        } finally {
            try {
                fis.close();
            } catch (IOException e) {
                System.out.println(e.getMessage());
            }
        }
        return false;
    }
//______________________________________________________________________________

    public boolean modificarfoto(String ruta) {
        int p = Integer.parseInt(lblIdAccidentes.getText());
        FileInputStream fis = null;
        try {
            File file = new File(ruta);
            fis = new FileInputStream(file);
            PreparedStatement pstm = BaseDeDatos.con.prepareStatement("Update accidente Set croquis = ? Where id = " + p);
            pstm.setBinaryStream(1, fis, (int) file.length());
            pstm.execute();
            pstm.close();
            return true;
        } catch (FileNotFoundException | SQLException e) {
            System.out.println(e.getMessage());
        } finally {
            try {
                fis.close();
            } catch (IOException e) {
                System.out.println(e.getMessage());
            }
        }
        return false;
    }
//______________________________________________________________________________

//    private void llenarGrado() {
//        
//        BaseDeDatos.conectarse();
//        String id = lblIdAccidentes.getText();
//        try {
//
//            sql = "select lesionados, muertos from accidente where id = " + id;
//
//            Statement s = BaseDeDatos.con.createStatement();
//            ResultSet rs = s.executeQuery(sql);
//
//            while (rs.next()) {
//                String lesionados = rs.getString("lesionados");
//                String muertos = rs.getString("muertos");
//                txtNuevosLesionados.setText("" + lesionados);
//                txtNuevosMuertos.setText("" + muertos);
//            }
//
//        } catch (SQLException ex) {
//            JOptionPane.showMessageDialog(null, ex.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
//        }
//        BaseDeDatos.desconectarse();
//    }
//______________________________________________________________________________
    @SuppressWarnings("CallToThreadDumpStack")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        dlgDescripcion = new javax.swing.JDialog();
        jScrollPane1 = new javax.swing.JScrollPane();
        txtDescripcion = new javax.swing.JTextArea();
        btnGuardar = new javax.swing.JButton();
        btnLimpiar = new javax.swing.JButton();
        dlgTablaAccidentes = new javax.swing.JDialog();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        tablaAccidentes = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int colIndex) {
                return false; //Disallow the editing of any cell
            }
        };
        btnEliminar = new javax.swing.JButton();
        lblIdAccidentes = new javax.swing.JLabel();
        btnmodificar = new javax.swing.JButton();
        jLabel15 = new javax.swing.JLabel();
        cbxFiltrarAccidente = new javax.swing.JComboBox();
        txtBuscarAccidente = new javax.swing.JTextField();
        dcFechaAccidente = new com.toedter.calendar.JDateChooser();
        jButton1 = new javax.swing.JButton();
        dlgConductor = new javax.swing.JDialog();
        jPanel4 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        tablaConductor = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int colIndex) {
                return false; //Disallow the editing of any cell
            }
        };
        btnAceptarConductor = new javax.swing.JButton();
        btnConductorDos = new javax.swing.JButton();
        jLabel3 = new javax.swing.JLabel();
        cbxFiltrarConductor = new javax.swing.JComboBox();
        txtBuscarConductor = new javax.swing.JTextField();
        dlgVehiculo = new javax.swing.JDialog();
        jPanel5 = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        tablaVehiculo = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int colIndex) {
                return false; //Disallow the editing of any cell
            }
        };
        btnAceptarVehiculo = new javax.swing.JButton();
        btnVehiculoDos = new javax.swing.JButton();
        jLabel14 = new javax.swing.JLabel();
        cbxFiltrarVehiculo = new javax.swing.JComboBox();
        txtBuscarVehiculo = new javax.swing.JTextField();
        dlgRuta = new javax.swing.JDialog();
        jPanel6 = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        tablaRutas = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int colIndex) {
                return false; //Disallow the editing of any cell
            }
        };
        btnAceptarRuta = new javax.swing.JButton();
        btnRutaDos = new javax.swing.JButton();
        dlgModificar = new javax.swing.JDialog();
        jPanel7 = new javax.swing.JPanel();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        jLabel26 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        cbxNuevoTipo = new javax.swing.JComboBox();
        cbxNuevoGrado = new javax.swing.JComboBox();
        SeleccionarRuta = new javax.swing.JButton();
        txtNuevaRuta = new javax.swing.JTextField();
        txtNuevoLugar = new javax.swing.JTextField();
        txtNuevaHora = new javax.swing.JFormattedTextField();
        dcNuevaFecha = new com.toedter.calendar.JDateChooser();
        txtNuevosLesionados = new javax.swing.JTextField();
        jLabel29 = new javax.swing.JLabel();
        txtNuevosMuertos = new javax.swing.JTextField();
        SeleccionarConductor = new javax.swing.JButton();
        txtNuevoConductor = new javax.swing.JTextField();
        txtNuevoVehiculo = new javax.swing.JTextField();
        SeleccionarVehiculo = new javax.swing.JButton();
        btnNuevaDescripcion = new javax.swing.JButton();
        lblIdGradoModificar = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        rbtnCasoCerrado = new javax.swing.JRadioButton();
        rbtnCasoAbierto = new javax.swing.JRadioButton();
        lblCaso = new javax.swing.JLabel();
        jPanel9 = new javax.swing.JPanel();
        jScrollPane7 = new javax.swing.JScrollPane();
        lstDocumentos = new javax.swing.JList();
        btnAdjuntarDocumento = new javax.swing.JButton();
        btnQuitarDocumento = new javax.swing.JButton();
        jPanel10 = new javax.swing.JPanel();
        btnAceptarAccidente = new javax.swing.JButton();
        btnCancelarAccidente = new javax.swing.JButton();
        dlgCargandoDatos = new javax.swing.JDialog();
        pbCargarDatos = new javax.swing.JProgressBar();
        dlgCarta = new javax.swing.JDialog();
        jPanel8 = new javax.swing.JPanel();
        jLabel31 = new javax.swing.JLabel();
        lblCond = new javax.swing.JLabel();
        jLabel34 = new javax.swing.JLabel();
        lblCed = new javax.swing.JLabel();
        jLabel35 = new javax.swing.JLabel();
        lblFech = new javax.swing.JLabel();
        jLabel36 = new javax.swing.JLabel();
        jLabel37 = new javax.swing.JLabel();
        jLabel38 = new javax.swing.JLabel();
        txtNomAtt = new javax.swing.JTextField();
        jLabel39 = new javax.swing.JLabel();
        txtCedAtt = new javax.swing.JTextField();
        jLabel40 = new javax.swing.JLabel();
        txtCedLugAtt = new javax.swing.JTextField();
        jLabel41 = new javax.swing.JLabel();
        txtPuesAtt = new javax.swing.JTextField();
        jLabel42 = new javax.swing.JLabel();
        rbtnNo = new javax.swing.JRadioButton();
        rbtnSi = new javax.swing.JRadioButton();
        btnVersion = new javax.swing.JButton();
        btnCancelar = new javax.swing.JButton();
        buttonGroup1 = new javax.swing.ButtonGroup();
        dlgAdjuntos = new javax.swing.JDialog();
        btnAgregar = new javax.swing.JButton();
        jScrollPane6 = new javax.swing.JScrollPane();
        lstAdjuntos = new javax.swing.JList();
        btnQuitar = new javax.swing.JButton();
        btnAdjuntar = new javax.swing.JButton();
        lblIdDoc = new javax.swing.JLabel();
        buttonGroup2 = new javax.swing.ButtonGroup();
        buttonGroup3 = new javax.swing.ButtonGroup();
        jLabel1 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        txtLesionados = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        txtMuertos = new javax.swing.JTextField();
        btnDescripcion = new javax.swing.JButton();
        btnIngresar = new javax.swing.JButton();
        lblDescripcion = new javax.swing.JLabel();
        btnSeleccionarConductor = new javax.swing.JButton();
        btnSeleccionarVehiculo = new javax.swing.JButton();
        btnVerTabla = new javax.swing.JButton();
        txtConductor = new javax.swing.JTextField();
        txtVehiculo = new javax.swing.JTextField();
        lblIdConductor = new javax.swing.JLabel();
        lblIdRuta = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        lblIdTipoAccidente = new javax.swing.JLabel();
        txtHora = new javax.swing.JFormattedTextField();
        txtLugar = new javax.swing.JTextField();
        cbxTipo = new javax.swing.JComboBox();
        jLabel23 = new javax.swing.JLabel();
        cbxGrado = new javax.swing.JComboBox();
        dcFecha = new com.toedter.calendar.JDateChooser();
        lblIdGrado = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        txtRuta = new javax.swing.JTextField();
        btnSeleccionarRuta = new javax.swing.JButton();
        lblFecha = new javax.swing.JLabel();
        lblIdAccidente = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        rbtnCerrado = new javax.swing.JRadioButton();
        rbtnAbierto = new javax.swing.JRadioButton();

        dlgDescripcion.setTitle("Descripcion");
        dlgDescripcion.setMinimumSize(new java.awt.Dimension(443, 438));
        dlgDescripcion.setModal(true);
        dlgDescripcion.setResizable(false);

        txtDescripcion.setColumns(20);
        txtDescripcion.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
        txtDescripcion.setLineWrap(true);
        txtDescripcion.setRows(5);
        txtDescripcion.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtDescripcion.setMaximumSize(new java.awt.Dimension(222, 87));
        txtDescripcion.setMinimumSize(new java.awt.Dimension(222, 87));
        jScrollPane1.setViewportView(txtDescripcion);

        btnGuardar.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnGuardar.setText("Guardar");
        btnGuardar.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        btnGuardar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGuardarActionPerformed(evt);
            }
        });

        btnLimpiar.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnLimpiar.setText("Limpiar");
        btnLimpiar.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        btnLimpiar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnLimpiarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout dlgDescripcionLayout = new javax.swing.GroupLayout(dlgDescripcion.getContentPane());
        dlgDescripcion.getContentPane().setLayout(dlgDescripcionLayout);
        dlgDescripcionLayout.setHorizontalGroup(
            dlgDescripcionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgDescripcionLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addGroup(dlgDescripcionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 415, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(dlgDescripcionLayout.createSequentialGroup()
                        .addComponent(btnGuardar, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnLimpiar, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18))
        );
        dlgDescripcionLayout.setVerticalGroup(
            dlgDescripcionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgDescripcionLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 347, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(10, 10, 10)
                .addGroup(dlgDescripcionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnGuardar, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnLimpiar, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(47, Short.MAX_VALUE))
        );

        dlgTablaAccidentes.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        dlgTablaAccidentes.setTitle("Accidentes");
        dlgTablaAccidentes.setMinimumSize(new java.awt.Dimension(795, 561));
        dlgTablaAccidentes.setModal(true);
        dlgTablaAccidentes.setResizable(false);
        dlgTablaAccidentes.addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosed(java.awt.event.WindowEvent evt) {
                dlgTablaAccidentesWindowClosed(evt);
            }
        });

        tablaAccidentes.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        tablaAccidentes.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        tablaAccidentes.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
        tablaAccidentes.getTableHeader().setReorderingAllowed(false);
        jScrollPane2.setViewportView(tablaAccidentes);

        btnEliminar.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnEliminar.setText("Eliminar");
        btnEliminar.setBorder(null);
        btnEliminar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEliminarActionPerformed(evt);
            }
        });

        lblIdAccidentes.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        btnmodificar.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnmodificar.setText("Modificar");
        btnmodificar.setBorder(null);
        btnmodificar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnmodificarActionPerformed(evt);
            }
        });

        jLabel15.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel15.setText("Filtrar por:");

        cbxFiltrarAccidente.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        cbxFiltrarAccidente.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Placa", "Fecha" }));
        cbxFiltrarAccidente.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        cbxFiltrarAccidente.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                cbxFiltrarAccidenteItemStateChanged(evt);
            }
        });

        txtBuscarAccidente.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtBuscarAccidente.addCaretListener(new javax.swing.event.CaretListener() {
            public void caretUpdate(javax.swing.event.CaretEvent evt) {
                txtBuscarAccidenteCaretUpdate(evt);
            }
        });

        dcFechaAccidente.setDateFormatString("yyyy-MM-d");
        dcFechaAccidente.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        dcFechaAccidente.setMinSelectableDate(new java.util.Date(-62135744284000L));

        jButton1.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jButton1.setText("Version de los hechos");
        jButton1.setMaximumSize(new java.awt.Dimension(52, 15));
        jButton1.setMinimumSize(new java.awt.Dimension(53, 15));
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(btnEliminar, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnmodificar, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 177, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(lblIdAccidentes, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 332, Short.MAX_VALUE))
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 755, Short.MAX_VALUE)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(cbxFiltrarAccidente, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(dcFechaAccidente, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtBuscarAccidente, javax.swing.GroupLayout.DEFAULT_SIZE, 462, Short.MAX_VALUE)))
                .addGap(10, 10, 10))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cbxFiltrarAccidente, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtBuscarAccidente, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(dcFechaAccidente, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 427, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnmodificar, javax.swing.GroupLayout.DEFAULT_SIZE, 24, Short.MAX_VALUE)
                    .addComponent(btnEliminar, javax.swing.GroupLayout.DEFAULT_SIZE, 24, Short.MAX_VALUE)
                    .addComponent(lblIdAccidentes, javax.swing.GroupLayout.DEFAULT_SIZE, 24, Short.MAX_VALUE)
                    .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 24, Short.MAX_VALUE))
                .addGap(11, 11, 11))
        );

        javax.swing.GroupLayout dlgTablaAccidentesLayout = new javax.swing.GroupLayout(dlgTablaAccidentes.getContentPane());
        dlgTablaAccidentes.getContentPane().setLayout(dlgTablaAccidentesLayout);
        dlgTablaAccidentesLayout.setHorizontalGroup(
            dlgTablaAccidentesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgTablaAccidentesLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        dlgTablaAccidentesLayout.setVerticalGroup(
            dlgTablaAccidentesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgTablaAccidentesLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(33, Short.MAX_VALUE))
        );

        dlgConductor.setTitle("Conductores");
        dlgConductor.setMinimumSize(new java.awt.Dimension(523, 434));
        dlgConductor.setModal(true);
        dlgConductor.setResizable(false);

        tablaConductor.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        tablaConductor.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        tablaConductor.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
        jScrollPane3.setViewportView(tablaConductor);

        btnAceptarConductor.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnAceptarConductor.setText("Aceptar");
        btnAceptarConductor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        btnAceptarConductor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAceptarConductorActionPerformed(evt);
            }
        });

        btnConductorDos.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnConductorDos.setText("Aceptar");
        btnConductorDos.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        btnConductorDos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnConductorDosActionPerformed(evt);
            }
        });

        jLabel3.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel3.setText("Filtrar por:");

        cbxFiltrarConductor.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        cbxFiltrarConductor.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Nombre", "Cedula" }));
        cbxFiltrarConductor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        cbxFiltrarConductor.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                cbxFiltrarConductorItemStateChanged(evt);
            }
        });

        txtBuscarConductor.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtBuscarConductor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtBuscarConductor.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                txtBuscarConductorKeyReleased(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 483, Short.MAX_VALUE)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(btnAceptarConductor, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnConductorDos, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 277, Short.MAX_VALUE))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(10, 10, 10)
                        .addComponent(cbxFiltrarConductor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtBuscarConductor, javax.swing.GroupLayout.DEFAULT_SIZE, 331, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cbxFiltrarConductor, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtBuscarConductor, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 308, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnAceptarConductor, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnConductorDos, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        javax.swing.GroupLayout dlgConductorLayout = new javax.swing.GroupLayout(dlgConductor.getContentPane());
        dlgConductor.getContentPane().setLayout(dlgConductorLayout);
        dlgConductorLayout.setHorizontalGroup(
            dlgConductorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgConductorLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        dlgConductorLayout.setVerticalGroup(
            dlgConductorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgConductorLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(22, Short.MAX_VALUE))
        );

        dlgVehiculo.setTitle("Vehiculos");
        dlgVehiculo.setMinimumSize(new java.awt.Dimension(523, 404));
        dlgVehiculo.setModal(true);
        dlgVehiculo.setResizable(false);

        tablaVehiculo.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        tablaVehiculo.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
        jScrollPane4.setViewportView(tablaVehiculo);

        btnAceptarVehiculo.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnAceptarVehiculo.setText("Aceptar");
        btnAceptarVehiculo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        btnAceptarVehiculo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAceptarVehiculoActionPerformed(evt);
            }
        });

        btnVehiculoDos.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnVehiculoDos.setText("Aceptar");
        btnVehiculoDos.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        btnVehiculoDos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnVehiculoDosActionPerformed(evt);
            }
        });

        jLabel14.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel14.setText("Filtrar por:");

        cbxFiltrarVehiculo.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        cbxFiltrarVehiculo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Placa", "N° Interno" }));
        cbxFiltrarVehiculo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        txtBuscarVehiculo.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N
        txtBuscarVehiculo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtBuscarVehiculo.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                txtBuscarVehiculoKeyReleased(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(cbxFiltrarVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtBuscarVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, 321, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 483, Short.MAX_VALUE)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(btnAceptarVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnVehiculoDos, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cbxFiltrarVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtBuscarVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 276, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnAceptarVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnVehiculoDos, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        javax.swing.GroupLayout dlgVehiculoLayout = new javax.swing.GroupLayout(dlgVehiculo.getContentPane());
        dlgVehiculo.getContentPane().setLayout(dlgVehiculoLayout);
        dlgVehiculoLayout.setHorizontalGroup(
            dlgVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgVehiculoLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        dlgVehiculoLayout.setVerticalGroup(
            dlgVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgVehiculoLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(26, Short.MAX_VALUE))
        );

        dlgRuta.setTitle("Ruta");
        dlgRuta.setMinimumSize(new java.awt.Dimension(523, 405));
        dlgRuta.setModal(true);
        dlgRuta.setResizable(false);

        tablaRutas.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        tablaRutas.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        tablaRutas.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
        tablaRutas.getTableHeader().setReorderingAllowed(false);
        jScrollPane5.setViewportView(tablaRutas);

        btnAceptarRuta.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnAceptarRuta.setText("Aceptar");
        btnAceptarRuta.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        btnAceptarRuta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAceptarRutaActionPerformed(evt);
            }
        });

        btnRutaDos.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnRutaDos.setText("Aceptar");
        btnRutaDos.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        btnRutaDos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnRutaDosActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addComponent(btnAceptarRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnRutaDos, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 277, Short.MAX_VALUE))
                    .addComponent(jScrollPane5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 483, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnAceptarRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnRutaDos, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(13, 13, 13))
        );

        javax.swing.GroupLayout dlgRutaLayout = new javax.swing.GroupLayout(dlgRuta.getContentPane());
        dlgRuta.getContentPane().setLayout(dlgRutaLayout);
        dlgRutaLayout.setHorizontalGroup(
            dlgRutaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgRutaLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        dlgRutaLayout.setVerticalGroup(
            dlgRutaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgRutaLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        dlgModificar.setTitle("Modificar Accidente");
        dlgModificar.setMinimumSize(new java.awt.Dimension(880, 570));
        dlgModificar.setModal(true);
        dlgModificar.setResizable(false);
        dlgModificar.addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                dlgModificarWindowClosing(evt);
            }
        });

        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Datos Accidente", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 0, 12), new java.awt.Color(0, 0, 0))); // NOI18N

        jLabel16.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel16.setText("Tipo:");

        jLabel17.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel17.setText("Grado:");

        jLabel18.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel18.setText("Ruta:");

        jLabel19.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel19.setText("Lugar:");

        jLabel20.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel20.setText("Hora:");

        jLabel21.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel21.setText("Fecha:");

        jLabel22.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel22.setText("N° Lesionados:");

        jLabel25.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel25.setText("Conductor:");

        jLabel26.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel26.setText("Vehiculo:");

        jLabel27.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel27.setText("Descripción");

        cbxNuevoTipo.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        cbxNuevoTipo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-------------------------------------------------------", "Provocado", "No provocado", "Natural" }));
        cbxNuevoTipo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        cbxNuevoTipo.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                cbxNuevoTipoItemStateChanged(evt);
            }
        });

        cbxNuevoGrado.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        cbxNuevoGrado.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-------------------------------------------------------", "Daños materiales", "Daños materiales y lesionados", "Daños materiales y muertos" }));
        cbxNuevoGrado.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        cbxNuevoGrado.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                cbxNuevoGradoItemStateChanged(evt);
            }
        });

        SeleccionarRuta.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        SeleccionarRuta.setText("Seleccionar");
        SeleccionarRuta.setBorder(null);
        SeleccionarRuta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SeleccionarRutaActionPerformed(evt);
            }
        });

        txtNuevaRuta.setEditable(false);
        txtNuevaRuta.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtNuevaRuta.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        txtNuevoLugar.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtNuevoLugar.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        txtNuevaHora.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        try {
            txtNuevaHora.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##:##")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        txtNuevaHora.setToolTipText("HH:MM");
        txtNuevaHora.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                txtNuevaHoraKeyReleased(evt);
            }
        });

        dcNuevaFecha.setDateFormatString("yyyy-MM-d");
        dcNuevaFecha.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N

        txtNuevosLesionados.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtNuevosLesionados.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtNuevosLesionados.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                txtNuevosLesionadosFocusLost(evt);
            }
        });
        txtNuevosLesionados.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                txtNuevosLesionadosKeyReleased(evt);
            }
        });

        jLabel29.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel29.setText("N° Muertos:");

        txtNuevosMuertos.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtNuevosMuertos.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtNuevosMuertos.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                txtNuevosMuertosFocusLost(evt);
            }
        });
        txtNuevosMuertos.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                txtNuevosMuertosKeyReleased(evt);
            }
        });

        SeleccionarConductor.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        SeleccionarConductor.setText("Seleccionar");
        SeleccionarConductor.setBorder(null);
        SeleccionarConductor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SeleccionarConductorActionPerformed(evt);
            }
        });

        txtNuevoConductor.setEditable(false);
        txtNuevoConductor.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtNuevoConductor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        txtNuevoVehiculo.setEditable(false);
        txtNuevoVehiculo.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtNuevoVehiculo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        SeleccionarVehiculo.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        SeleccionarVehiculo.setText("Seleccionar");
        SeleccionarVehiculo.setBorder(null);
        SeleccionarVehiculo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SeleccionarVehiculoActionPerformed(evt);
            }
        });

        btnNuevaDescripcion.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnNuevaDescripcion.setText("Descripción");
        btnNuevaDescripcion.setBorder(null);
        btnNuevaDescripcion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNuevaDescripcionActionPerformed(evt);
            }
        });

        lblIdGradoModificar.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel28.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel28.setText("Estado del cado:");

        buttonGroup3.add(rbtnCasoCerrado);
        rbtnCasoCerrado.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        rbtnCasoCerrado.setText("Cerrado");

        buttonGroup3.add(rbtnCasoAbierto);
        rbtnCasoAbierto.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        rbtnCasoAbierto.setText("Abierto");

        lblCaso.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        lblCaso.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGap(15, 15, 15)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(jLabel22, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtNuevosLesionados, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel29, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtNuevoLugar))
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(txtNuevaRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtNuevaHora, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(SeleccionarRuta, javax.swing.GroupLayout.DEFAULT_SIZE, 75, Short.MAX_VALUE)
                            .addComponent(txtNuevosMuertos)))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(cbxNuevoTipo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(jLabel26, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtNuevoVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(SeleccionarVehiculo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(jLabel25, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtNuevoConductor, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(SeleccionarConductor, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(cbxNuevoGrado, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jLabel28, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel27, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnNuevaDescripcion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(jLabel21, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(dcNuevaFecha, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addGap(105, 105, 105)
                                .addComponent(rbtnCasoCerrado)
                                .addGap(18, 18, 18)
                                .addComponent(rbtnCasoAbierto)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(lblIdGradoModificar, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(lblCaso, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGap(15, 15, 15)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(cbxNuevoTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(15, 15, 15)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(cbxNuevoGrado, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(15, 15, 15)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(SeleccionarRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtNuevaRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(15, 15, 15)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtNuevoLugar, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(15, 15, 15)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtNuevaHora, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(15, 15, 15)
                        .addComponent(jLabel21, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(dcNuevaFecha, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel22, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtNuevosLesionados, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel29, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtNuevosMuertos, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel25, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SeleccionarConductor, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtNuevoConductor, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel26, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtNuevoVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(SeleccionarVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel27, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnNuevaDescripcion, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel28, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(rbtnCasoCerrado, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(rbtnCasoAbierto, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addComponent(lblIdGradoModificar, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(lblCaso, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder("Documentos Accidente"));

        lstDocumentos.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        lstDocumentos.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jScrollPane7.setViewportView(lstDocumentos);

        btnAdjuntarDocumento.setText("Adjuntar");
        btnAdjuntarDocumento.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAdjuntarDocumentoActionPerformed(evt);
            }
        });

        btnQuitarDocumento.setText("Quitar");
        btnQuitarDocumento.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnQuitarDocumentoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 304, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(btnAdjuntarDocumento, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnQuitarDocumento, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addComponent(btnAdjuntarDocumento, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnQuitarDocumento, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addComponent(jScrollPane7)
                        .addGap(15, 15, 15))))
        );

        jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        btnAceptarAccidente.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnAceptarAccidente.setText("Aceptar");
        btnAceptarAccidente.setBorder(null);
        btnAceptarAccidente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAceptarAccidenteActionPerformed(evt);
            }
        });

        btnCancelarAccidente.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnCancelarAccidente.setText("Cancelar");
        btnCancelarAccidente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCancelarAccidenteActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(btnAceptarAccidente, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnCancelarAccidente, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(637, Short.MAX_VALUE))
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnAceptarAccidente, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnCancelarAccidente, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout dlgModificarLayout = new javax.swing.GroupLayout(dlgModificar.getContentPane());
        dlgModificar.getContentPane().setLayout(dlgModificarLayout);
        dlgModificarLayout.setHorizontalGroup(
            dlgModificarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgModificarLayout.createSequentialGroup()
                .addGroup(dlgModificarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(dlgModificarLayout.createSequentialGroup()
                        .addContainerGap(12, Short.MAX_VALUE)
                        .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, dlgModificarLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(0, 11, Short.MAX_VALUE))
        );
        dlgModificarLayout.setVerticalGroup(
            dlgModificarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgModificarLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addGroup(dlgModificarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, 468, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(10, 10, 10)
                .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(26, Short.MAX_VALUE))
        );

        dlgCargandoDatos.setTitle("Cargando Datos...");
        dlgCargandoDatos.setMinimumSize(new java.awt.Dimension(267, 72));
        dlgCargandoDatos.setModal(true);
        dlgCargandoDatos.setResizable(false);

        pbCargarDatos.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        javax.swing.GroupLayout dlgCargandoDatosLayout = new javax.swing.GroupLayout(dlgCargandoDatos.getContentPane());
        dlgCargandoDatos.getContentPane().setLayout(dlgCargandoDatosLayout);
        dlgCargandoDatosLayout.setHorizontalGroup(
            dlgCargandoDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgCargandoDatosLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pbCargarDatos, javax.swing.GroupLayout.DEFAULT_SIZE, 247, Short.MAX_VALUE)
                .addContainerGap())
        );
        dlgCargandoDatosLayout.setVerticalGroup(
            dlgCargandoDatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgCargandoDatosLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pbCargarDatos, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(37, Short.MAX_VALUE))
        );

        dlgCarta.setTitle("Versión De los Hechos ");
        dlgCarta.setLocationByPlatform(true);
        dlgCarta.setMinimumSize(new java.awt.Dimension(538, 350));
        dlgCarta.setModal(true);
        dlgCarta.setResizable(false);

        jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)), "Generar Versión De Los Hechos", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, new java.awt.Color(0, 0, 0)));
        jPanel8.setMaximumSize(new java.awt.Dimension(571, 440));
        jPanel8.setMinimumSize(new java.awt.Dimension(571, 440));
        jPanel8.setPreferredSize(new java.awt.Dimension(571, 440));

        jLabel31.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        jLabel31.setText("La versión de los Hechos se Ralizara sobre el  conductor");

        lblCond.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        lblCond.setBorder(new javax.swing.border.MatteBorder(null));

        jLabel34.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        jLabel34.setText("identificado con la cédula");

        lblCed.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        lblCed.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblCed.setBorder(new javax.swing.border.MatteBorder(null));

        jLabel35.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        jLabel35.setText("donde la fecha de accidente es");

        lblFech.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        lblFech.setText("9999-12-31");
        lblFech.setBorder(new javax.swing.border.MatteBorder(null));

        jLabel36.setText(".");

        jLabel37.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel37.setText("Atentamente:");

        jLabel38.setText("Nombre:");

        txtNomAtt.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel39.setText("Cédula:");

        txtCedAtt.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel40.setText("de");

        txtCedLugAtt.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel41.setText("Puesto:");

        txtPuesAtt.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel42.setText("Generar Firma del Conductor Accidentado ?");

        buttonGroup1.add(rbtnNo);
        rbtnNo.setText("No");

        buttonGroup1.add(rbtnSi);
        rbtnSi.setText("Si");

        btnVersion.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnVersion.setText("Generar version...");
        btnVersion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnVersionActionPerformed(evt);
            }
        });

        btnCancelar.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnCancelar.setText("Cancelar");
        btnCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCancelarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(jLabel42)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(rbtnNo)
                        .addGap(10, 10, 10)
                        .addComponent(rbtnSi))
                    .addComponent(jLabel37)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jLabel41, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel39, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel38, javax.swing.GroupLayout.DEFAULT_SIZE, 47, Short.MAX_VALUE))
                        .addGap(10, 10, 10)
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(txtNomAtt, javax.swing.GroupLayout.PREFERRED_SIZE, 260, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel8Layout.createSequentialGroup()
                                .addComponent(txtCedAtt, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(6, 6, 6)
                                .addComponent(jLabel40)
                                .addGap(6, 6, 6)
                                .addComponent(txtCedLugAtt))
                            .addComponent(txtPuesAtt, javax.swing.GroupLayout.PREFERRED_SIZE, 260, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(btnVersion, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(jLabel34)
                        .addGap(6, 6, 6)
                        .addComponent(lblCed, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(6, 6, 6)
                        .addComponent(jLabel35, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblFech, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, 0)
                        .addComponent(jLabel36, javax.swing.GroupLayout.PREFERRED_SIZE, 12, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(jLabel31)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(lblCond, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel31, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblCond, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(10, 10, 10)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel34, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(lblCed, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel35, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(lblFech, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel36, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(9, 9, 9)
                .addComponent(jLabel37)
                .addGap(10, 10, 10)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel38, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtNomAtt, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(10, 10, 10)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel40, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtCedAtt, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtCedLugAtt, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel39, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(10, 10, 10)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtPuesAtt, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel41, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(10, 10, 10)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel42, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(rbtnNo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(rbtnSi, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(20, 20, 20)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnVersion, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        javax.swing.GroupLayout dlgCartaLayout = new javax.swing.GroupLayout(dlgCarta.getContentPane());
        dlgCarta.getContentPane().setLayout(dlgCartaLayout);
        dlgCartaLayout.setHorizontalGroup(
            dlgCartaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgCartaLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, 518, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(10, 10, 10))
        );
        dlgCartaLayout.setVerticalGroup(
            dlgCartaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgCartaLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, 302, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(10, 10, 10))
        );

        dlgAdjuntos.setMinimumSize(new java.awt.Dimension(425, 310));
        dlgAdjuntos.setModal(true);
        dlgAdjuntos.setResizable(false);
        dlgAdjuntos.addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosed(java.awt.event.WindowEvent evt) {
                dlgAdjuntosWindowClosed(evt);
            }
        });

        btnAgregar.setText("Agregar...");
        btnAgregar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAgregarActionPerformed(evt);
            }
        });

        lstAdjuntos.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        lstAdjuntos.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
            public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
                lstAdjuntosValueChanged(evt);
            }
        });
        jScrollPane6.setViewportView(lstAdjuntos);

        btnQuitar.setText("Quitar");
        btnQuitar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnQuitarActionPerformed(evt);
            }
        });

        btnAdjuntar.setText("Aceptar");
        btnAdjuntar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAdjuntarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout dlgAdjuntosLayout = new javax.swing.GroupLayout(dlgAdjuntos.getContentPane());
        dlgAdjuntos.getContentPane().setLayout(dlgAdjuntosLayout);
        dlgAdjuntosLayout.setHorizontalGroup(
            dlgAdjuntosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, dlgAdjuntosLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 304, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addGroup(dlgAdjuntosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(btnAgregar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnQuitar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnAdjuntar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, dlgAdjuntosLayout.createSequentialGroup()
                .addContainerGap(320, Short.MAX_VALUE)
                .addComponent(lblIdDoc, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(34, 34, 34))
        );
        dlgAdjuntosLayout.setVerticalGroup(
            dlgAdjuntosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(dlgAdjuntosLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(dlgAdjuntosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(dlgAdjuntosLayout.createSequentialGroup()
                        .addComponent(btnAgregar, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnQuitar, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btnAdjuntar, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 258, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lblIdDoc, javax.swing.GroupLayout.DEFAULT_SIZE, 16, Short.MAX_VALUE))
        );

        setMaximumSize(new java.awt.Dimension(973, 662));
        setMinimumSize(new java.awt.Dimension(973, 662));

        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/logo.png"))); // NOI18N

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)), "Ingresar Nuevo Accidente", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 0, 14))); // NOI18N
        jPanel1.setMaximumSize(new java.awt.Dimension(953, 503));
        jPanel1.setMinimumSize(new java.awt.Dimension(953, 503));

        jLabel4.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel4.setText("Lugar:");

        jLabel5.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel5.setText("Hora:");

        jLabel6.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel6.setText("Fecha:");

        jLabel7.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel7.setText("N° Lesionados:");

        jLabel8.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel8.setText("N° Muertos:");

        jLabel9.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel9.setText("Conductor:");

        jLabel10.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel10.setText("Vehiculo:");

        txtLesionados.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtLesionados.setText("0");
        txtLesionados.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtLesionados.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                txtLesionadosFocusLost(evt);
            }
        });
        txtLesionados.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                txtLesionadosKeyReleased(evt);
            }
        });

        jLabel11.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel11.setText("Descripción:");

        txtMuertos.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtMuertos.setText("0");
        txtMuertos.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        txtMuertos.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                txtMuertosFocusLost(evt);
            }
        });
        txtMuertos.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                txtMuertosKeyReleased(evt);
            }
        });

        btnDescripcion.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnDescripcion.setText("Hacer Descripción");
        btnDescripcion.setBorder(null);
        btnDescripcion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDescripcionActionPerformed(evt);
            }
        });

        btnIngresar.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnIngresar.setText("Ingresar");
        btnIngresar.setBorder(null);
        btnIngresar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnIngresarActionPerformed(evt);
            }
        });

        lblDescripcion.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        btnSeleccionarConductor.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnSeleccionarConductor.setText("Seleccionar");
        btnSeleccionarConductor.setBorder(null);
        btnSeleccionarConductor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSeleccionarConductorActionPerformed(evt);
            }
        });

        btnSeleccionarVehiculo.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnSeleccionarVehiculo.setText("Seleccionar");
        btnSeleccionarVehiculo.setBorder(null);
        btnSeleccionarVehiculo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSeleccionarVehiculoActionPerformed(evt);
            }
        });

        btnVerTabla.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnVerTabla.setText("Ver Tabla");
        btnVerTabla.setBorder(null);
        btnVerTabla.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnVerTablaActionPerformed(evt);
            }
        });

        txtConductor.setEditable(false);
        txtConductor.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtConductor.setToolTipText("");
        txtConductor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));

        txtVehiculo.setEditable(false);
        txtVehiculo.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtVehiculo.setToolTipText("");
        txtVehiculo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));

        lblIdConductor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        lblIdRuta.setForeground(new java.awt.Color(0, 51, 51));
        lblIdRuta.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel12.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel12.setText("Tipo:");

        lblIdTipoAccidente.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        txtHora.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        try {
            txtHora.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##:##")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        txtHora.setToolTipText("HH:MM");
        txtHora.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));
        txtHora.setName(""); // NOI18N
        txtHora.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                txtHoraKeyReleased(evt);
            }
        });

        txtLugar.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtLugar.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        cbxTipo.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        cbxTipo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "[Seleccione tipo de accidente]", "Provocado", "No provocado", "Natural" }));
        cbxTipo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        cbxTipo.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                cbxTipoItemStateChanged(evt);
            }
        });

        jLabel23.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel23.setText("Grado:");

        cbxGrado.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        cbxGrado.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "[Seleccione grado del accidente]", "Daños materiales", "Daños materiales y lesionados", "Daños materiales y muertos" }));
        cbxGrado.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        cbxGrado.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                cbxGradoItemStateChanged(evt);
            }
        });

        dcFecha.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 0));
        dcFecha.setDateFormatString("d-MM-yyyy");

        lblIdGrado.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel2.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel2.setText("Ruta:");

        txtRuta.setEditable(false);
        txtRuta.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        txtRuta.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));

        btnSeleccionarRuta.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        btnSeleccionarRuta.setText("Seleccionar");
        btnSeleccionarRuta.setBorder(null);
        btnSeleccionarRuta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSeleccionarRutaActionPerformed(evt);
            }
        });

        lblFecha.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        lblIdAccidente.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel24.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
        jLabel24.setText("Estado del Caso:");

        buttonGroup2.add(rbtnCerrado);
        rbtnCerrado.setFont(new java.awt.Font("Arial", 1, 11)); // NOI18N
        rbtnCerrado.setText("Cerrado");

        buttonGroup2.add(rbtnAbierto);
        rbtnAbierto.setFont(new java.awt.Font("Arial", 1, 11)); // NOI18N
        rbtnAbierto.setText("Abierto");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(290, 290, 290)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel24)
                        .addContainerGap())
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jLabel23, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jLabel7, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jLabel12, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jLabel4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jLabel5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jLabel6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jLabel11, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jLabel10, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jLabel9, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(18, 18, 18)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(cbxTipo, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(dcFecha, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(txtHora, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGap(0, 0, Short.MAX_VALUE))
                                    .addComponent(cbxGrado, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(txtConductor, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(txtVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGroup(jPanel1Layout.createSequentialGroup()
                                                .addComponent(txtLesionados, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(18, 18, 18)
                                                .addComponent(jLabel8)))
                                        .addGap(0, 0, Short.MAX_VALUE)
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(btnSeleccionarConductor, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(btnSeleccionarVehiculo, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 75, Short.MAX_VALUE)
                                            .addComponent(txtMuertos, javax.swing.GroupLayout.Alignment.TRAILING)))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addGap(0, 0, Short.MAX_VALUE)
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addGroup(jPanel1Layout.createSequentialGroup()
                                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(txtLugar, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(txtRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(btnSeleccionarRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addComponent(btnDescripcion, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                                .addComponent(rbtnCerrado)
                                                .addGap(18, 18, 18)
                                                .addComponent(rbtnAbierto))))))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(btnIngresar, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(btnVerTabla, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(lblIdTipoAccidente, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(5, 5, 5)
                                .addComponent(lblIdGrado, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(5, 5, 5)
                                .addComponent(lblIdRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(4, 4, 4)
                                .addComponent(lblFecha, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(lblIdConductor, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(5, 5, 5)
                                .addComponent(lblDescripcion, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(lblIdAccidente, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(290, 290, 290))))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cbxTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel23, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cbxGrado, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnSeleccionarRuta, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtLugar, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtHora, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(dcFecha, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtLesionados, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtMuertos, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(txtConductor, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(btnSeleccionarConductor, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(14, 14, 14)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(15, 15, 15)
                        .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(btnSeleccionarVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(15, 15, 15)
                        .addComponent(btnDescripcion, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel24)
                    .addComponent(rbtnCerrado)
                    .addComponent(rbtnAbierto))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(btnIngresar, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(btnVerTabla, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(lblIdTipoAccidente, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(lblIdRuta, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(lblIdGrado, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(lblIdConductor, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(lblDescripcion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(lblFecha, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(lblIdAccidente, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(21, Short.MAX_VALUE))
        );

        txtHora.getAccessibleContext().setAccessibleName("");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(12, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(11, 11, 11))
        );
    }// </editor-fold>//GEN-END:initComponents
//______________________________________________________________________________

    private void btnDescripcionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDescripcionActionPerformed

        llamarDialog();

    }//GEN-LAST:event_btnDescripcionActionPerformed
//______________________________________________________________________________

    private void btnGuardarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGuardarActionPerformed

        pasarTexto();

    }//GEN-LAST:event_btnGuardarActionPerformed
//______________________________________________________________________________

    private void btnLimpiarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLimpiarActionPerformed

        txtDescripcion.setText("");
    }//GEN-LAST:event_btnLimpiarActionPerformed
//______________________________________________________________________________
//______________________________________________________________________________

    private void btnVerTablaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVerTablaActionPerformed

        new Thread(new hiloAccidentes()).start();
        lblCaso.setVisible(false);
        ((JTextFieldDateEditor) dcFechaAccidente.getDateEditor()).setEditable(false);
        tablaAccidentes.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        tablaAccidentes.setAutoCreateRowSorter(true);
        dlgCargandoDatos.setLocationRelativeTo(null);
        dlgCargandoDatos.setVisible(true);

    }//GEN-LAST:event_btnVerTablaActionPerformed
//______________________________________________________________________________

    private void btnSeleccionarConductorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSeleccionarConductorActionPerformed

        new Thread(new hiloConductores()).start();
        dlgCargandoDatos.setLocationRelativeTo(null);
        dlgCargandoDatos.setVisible(true);
        btnAceptarConductor.setVisible(true);
        btnConductorDos.setVisible(false);
        tablaConductor.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        tablaConductor.setAutoCreateRowSorter(true);

    }//GEN-LAST:event_btnSeleccionarConductorActionPerformed
//______________________________________________________________________________

    private void btnSeleccionarVehiculoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSeleccionarVehiculoActionPerformed

        new Thread(new hiloVehiculos()).start();
        dlgCargandoDatos.setLocationRelativeTo(null);
        dlgCargandoDatos.setVisible(true);
        btnAceptarVehiculo.setVisible(true);
        btnVehiculoDos.setVisible(false);
        tablaVehiculo.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        tablaVehiculo.setAutoCreateRowSorter(true);

    }//GEN-LAST:event_btnSeleccionarVehiculoActionPerformed
//______________________________________________________________________________

    private void btnIngresarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnIngresarActionPerformed

        int tipo = cbxTipo.getSelectedIndex();
        int grado = cbxGrado.getSelectedIndex();
        String ruta = txtRuta.getText();
        String lugar = txtLugar.getText();
        String fecha = lblFecha.getText();
        String hora = txtHora.getText();
        String lesionados = txtLesionados.getText();
        String muertos = txtMuertos.getText();
        String conductor = txtConductor.getText();
        String vehiculo = txtVehiculo.getText();
        String descripcion = lblDescripcion.getText();
        boolean valida = true;

        while (valida) {
            if (ValidacionesAccidentes.validaTipo(tipo) || ValidacionesAccidentes.validaTipo(grado) || ValidacionesAccidentes.validaVacio(ruta, txtRuta) || ValidacionesAccidentes.validaLugar(lugar, txtLugar)
                    || ValidacionesAccidentes.validaHora(hora, txtHora) || ValidacionesAccidentes.validaCalendario(fecha, ((JTextFieldDateEditor) dcFecha.getDateEditor())) || ValidacionesAccidentes.validaLesionados(lesionados, txtLesionados) || ValidacionesAccidentes.validaLesionados(muertos, txtMuertos)
                    || ValidacionesAccidentes.validaVacio(conductor, txtConductor) || ValidacionesAccidentes.validaVacio(vehiculo, txtVehiculo) || ValidacionesAccidentes.validaDesc(descripcion, btnDescripcion)) {
                JOptionPane.showMessageDialog(jPanel1, "Por favor verifique los datos", "Error", JOptionPane.ERROR_MESSAGE);
            } else {
                if (rbtnCerrado.isSelected() == true) {
                    caso = rbtnCerrado.getLabel();
                } else {
                    caso = rbtnAbierto.getLabel();
                }
                ingresarAccidente();
                int confirmar = JOptionPane.showConfirmDialog(null, "Desea agregar documentos a este caso?",
                        "Advertencia", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
                if (confirmar == JOptionPane.YES_NO_OPTION) {
                    dlgAdjuntos.setLocationRelativeTo(null);
                    dlgAdjuntos.setVisible(true);
                }
                txtLesionados.setText("0");
                txtMuertos.setText("0");
            }
            valida = false;
        }

    }//GEN-LAST:event_btnIngresarActionPerformed
//______________________________________________________________________________

    private void btnAceptarVehiculoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAceptarVehiculoActionPerformed

        if (tablaVehiculo.getSelectedRows().length < 1) {
            JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
        } else {
            txtVehiculo.setText("" + tablaVehiculo.getValueAt(tablaVehiculo.getSelectedRow(), 0));
            if (txtVehiculo.getText().equals("")) {
                txtVehiculo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));
            } else {
                txtVehiculo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
                dlgVehiculo.setVisible(false);
            }
        }

    }//GEN-LAST:event_btnAceptarVehiculoActionPerformed
//______________________________________________________________________________

    private void btnAceptarConductorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAceptarConductorActionPerformed

        if (tablaConductor.getSelectedRows().length < 1) {
            JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
        } else {
            txtConductor.setText("" + tablaConductor.getValueAt(tablaConductor.getSelectedRow(), 0));
            lblIdConductor.setText("" + tablaConductor.getValueAt(tablaConductor.getSelectedRow(), 1));

            if (txtConductor.getText().equals("")) {
                txtConductor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));
            } else {
                txtConductor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
                dlgConductor.setVisible(false);
            }
        }

    }//GEN-LAST:event_btnAceptarConductorActionPerformed
//______________________________________________________________________________

    private void btnEliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEliminarActionPerformed

        eliminarAccidente();

    }//GEN-LAST:event_btnEliminarActionPerformed
//______________________________________________________________________________

private void btnRutaDosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRutaDosActionPerformed

    if (tablaRutas.getSelectedRows().length < 1) {
        JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
    } else {
        txtNuevaRuta.setText("" + tablaRutas.getValueAt(tablaRutas.getSelectedRow(), 1));
        lblIdRuta.setText("" + tablaRutas.getValueAt(tablaRutas.getSelectedRow(), 0));

        if (txtNuevaRuta.getText().equals("")) {
            txtNuevaRuta.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));
        } else {
            txtNuevaRuta.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
            dlgRuta.setVisible(false);
        }
    }

}//GEN-LAST:event_btnRutaDosActionPerformed
//______________________________________________________________________________

private void btnAceptarRutaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAceptarRutaActionPerformed

    if (tablaRutas.getSelectedRows().length < 1) {
        JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
    } else {
        txtRuta.setText("" + tablaRutas.getValueAt(tablaRutas.getSelectedRow(), 1));
        lblIdRuta.setText("" + tablaRutas.getValueAt(tablaRutas.getSelectedRow(), 0));

        if (txtRuta.getText().equals("")) {
            txtRuta.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));
        } else {
            txtRuta.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
            dlgRuta.setVisible(false);
        }
    }

}//GEN-LAST:event_btnAceptarRutaActionPerformed
//______________________________________________________________________________

private void btnmodificarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnmodificarActionPerformed

    btnModificar();

}//GEN-LAST:event_btnmodificarActionPerformed
//______________________________________________________________________________

private void btnVehiculoDosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVehiculoDosActionPerformed

    if (tablaVehiculo.getSelectedRows().length < 1) {
        JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
    } else {
        txtNuevoVehiculo.setText("" + tablaVehiculo.getValueAt(tablaVehiculo.getSelectedRow(), 0));

        if (txtNuevoVehiculo.getText().equals("")) {
            txtNuevoVehiculo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));
        } else {
            txtNuevoVehiculo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
            dlgVehiculo.setVisible(false);
        }
    }

}//GEN-LAST:event_btnVehiculoDosActionPerformed
//______________________________________________________________________________

private void btnConductorDosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnConductorDosActionPerformed

    if (tablaConductor.getSelectedRows().length < 1) {
        JOptionPane.showMessageDialog(null, "Seleccione Una Fila", "Error", JOptionPane.ERROR_MESSAGE);
    } else {
        txtNuevoConductor.setText("" + tablaConductor.getValueAt(tablaConductor.getSelectedRow(), 0));
        lblIdConductor.setText("" + tablaConductor.getValueAt(tablaConductor.getSelectedRow(), 1));

        if (txtNuevoConductor.getText().equals("")) {
            txtNuevoConductor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));
        } else {
            txtNuevoConductor.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
            dlgConductor.setVisible(false);
        }
    }

}//GEN-LAST:event_btnConductorDosActionPerformed
//______________________________________________________________________________

    private void btnSeleccionarRutaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSeleccionarRutaActionPerformed

        new Thread(new hiloRutas()).start();
        dlgCargandoDatos.setLocationRelativeTo(null);
        dlgCargandoDatos.setVisible(true);
        btnAceptarRuta.setVisible(true);
        btnRutaDos.setVisible(false);
        tablaRutas.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        tablaRutas.setAutoCreateRowSorter(true);

    }//GEN-LAST:event_btnSeleccionarRutaActionPerformed
//______________________________________________________________________________

    private void cbxTipoItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cbxTipoItemStateChanged

        int valor = cbxTipo.getSelectedIndex();
        if (valor == 1) {
            lblIdTipoAccidente.setText("1");
        } else if (valor == 2) {
            lblIdTipoAccidente.setText("2");
        } else if (valor == 3) {
            lblIdTipoAccidente.setText("3");
        }

    }//GEN-LAST:event_cbxTipoItemStateChanged
//______________________________________________________________________________

    private void cbxGradoItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cbxGradoItemStateChanged

        int valor = cbxGrado.getSelectedIndex();
        if (valor == 0) {
            txtLesionados.setEnabled(false);
            txtMuertos.setEnabled(false);
            txtLesionados.setText("0");
            txtMuertos.setText("0");
        } else if (valor == 1) {
            txtLesionados.setText("0");
            txtMuertos.setText("0");
            lblIdGrado.setText("1");
            txtLesionados.setEnabled(false);
            txtMuertos.setEnabled(false);
            txtLesionados.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
            txtMuertos.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        } else if (valor == 2) {
            txtLesionados.setText("1");
            txtMuertos.setText("0");
            lblIdGrado.setText("2");
            txtLesionados.setEnabled(true);
            txtMuertos.setEnabled(false);
            txtLesionados.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
            txtMuertos.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        } else if (valor == 3) {
            txtLesionados.setText("0");
            txtMuertos.setText("1");
            txtLesionados.setEnabled(true);
            txtMuertos.setEnabled(true);
            lblIdGrado.setText("3");
            txtLesionados.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
            txtMuertos.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        }

    }//GEN-LAST:event_cbxGradoItemStateChanged
//______________________________________________________________________________

    private void txtBuscarConductorKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtBuscarConductorKeyReleased

        llenarConductores(txtBuscarConductor.getText());

    }//GEN-LAST:event_txtBuscarConductorKeyReleased
//______________________________________________________________________________

    private void cbxFiltrarConductorItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cbxFiltrarConductorItemStateChanged

        int valor = cbxFiltrarConductor.getSelectedIndex();
        if (valor == 0) {
            llenarConductores("");
            txtBuscarConductor.setText("");
        } else if (valor == 1) {
            llenarConductores("");
            txtBuscarConductor.setText("");
        }

    }//GEN-LAST:event_cbxFiltrarConductorItemStateChanged
//______________________________________________________________________________

    private void txtBuscarVehiculoKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtBuscarVehiculoKeyReleased

        llenarVehiculo(txtBuscarVehiculo.getText());

    }//GEN-LAST:event_txtBuscarVehiculoKeyReleased
//______________________________________________________________________________

    private void cbxFiltrarAccidenteItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cbxFiltrarAccidenteItemStateChanged

        int Valor_dos = cbxFiltrarAccidente.getSelectedIndex();

        if (Valor_dos == 1) {
//            llenarConductores("");
            dcFechaAccidente.setDate(null);
            txtBuscarAccidente.setVisible(false);
            dcFechaAccidente.setVisible(true);
            txtBuscarAccidente.setText("");
        } else if (Valor_dos == 0) {
//            llenarConductores("");
            dcFechaAccidente.setDate(null);
            txtBuscarAccidente.setVisible(true);
            dcFechaAccidente.setVisible(false);
            txtBuscarAccidente.setText("");
        }

    }//GEN-LAST:event_cbxFiltrarAccidenteItemStateChanged
//______________________________________________________________________________

    private void txtBuscarAccidenteCaretUpdate(javax.swing.event.CaretEvent evt) {//GEN-FIRST:event_txtBuscarAccidenteCaretUpdate

        if (txtBuscarConductor.getText() == null) {
            llenarAccidentes("");
        } else {
            llenarAccidentes(txtBuscarAccidente.getText());
        }

    }//GEN-LAST:event_txtBuscarAccidenteCaretUpdate
//______________________________________________________________________________

    private void dlgTablaAccidentesWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_dlgTablaAccidentesWindowClosed

        cbxFiltrarAccidente.setSelectedIndex(0);
        txtBuscarAccidente.setText("");

    }//GEN-LAST:event_dlgTablaAccidentesWindowClosed
//______________________________________________________________________________

    private void btnNuevaDescripcionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNuevaDescripcionActionPerformed

        llamarDialog();

    }//GEN-LAST:event_btnNuevaDescripcionActionPerformed
//______________________________________________________________________________

    private void cbxNuevoTipoItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cbxNuevoTipoItemStateChanged

        int valor = cbxNuevoTipo.getSelectedIndex();

        if (valor == 1) {
            lblIdTipoAccidente.setText("1");
        } else if (valor == 2) {
            lblIdTipoAccidente.setText("2");
        } else if (valor == 3) {
            lblIdTipoAccidente.setText("3");
        }

    }//GEN-LAST:event_cbxNuevoTipoItemStateChanged
//______________________________________________________________________________

    private void cbxNuevoGradoItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cbxNuevoGradoItemStateChanged

        int valor = cbxNuevoGrado.getSelectedIndex();
        if (valor == 0) {
            txtNuevosLesionados.setText("0");
            txtNuevosMuertos.setText("0");
            txtNuevosLesionados.setEnabled(false);
            txtNuevosMuertos.setEnabled(false);
        } else if (valor == 1) {
            lblIdGrado.setText("1");
            txtNuevosLesionados.setText("0");
            txtNuevosMuertos.setText("0");
            txtNuevosLesionados.setEnabled(false);
            txtNuevosMuertos.setEnabled(false);
        } else if (valor == 2) {
            lblIdGrado.setText("2");
            txtNuevosLesionados.setText("1");
            txtNuevosMuertos.setText("0");
            txtNuevosLesionados.setEnabled(true);
            txtNuevosMuertos.setEnabled(false);
        } else if (valor == 3) {
            lblIdGrado.setText("3");
            txtNuevosLesionados.setText("0");
            txtNuevosMuertos.setText("1");
            txtNuevosLesionados.setEnabled(true);
            txtNuevosMuertos.setEnabled(true);
        }

    }//GEN-LAST:event_cbxNuevoGradoItemStateChanged
//______________________________________________________________________________

    private void SeleccionarRutaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SeleccionarRutaActionPerformed

        new Thread(new hiloRutas()).start();
        dlgCargandoDatos.setLocationRelativeTo(null);
        dlgCargandoDatos.setVisible(true);
        btnAceptarRuta.setVisible(false);
        btnRutaDos.setVisible(true);
        tablaRutas.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        tablaRutas.setAutoCreateRowSorter(true);

    }//GEN-LAST:event_SeleccionarRutaActionPerformed
//______________________________________________________________________________

    private void SeleccionarConductorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SeleccionarConductorActionPerformed

        new Thread(new hiloConductores()).start();
        dlgCargandoDatos.setLocationRelativeTo(null);
        dlgCargandoDatos.setVisible(true);
        btnAceptarConductor.setVisible(false);
        btnConductorDos.setVisible(true);
        tablaConductor.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        tablaConductor.setAutoCreateRowSorter(true);

    }//GEN-LAST:event_SeleccionarConductorActionPerformed
//______________________________________________________________________________

    private void SeleccionarVehiculoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SeleccionarVehiculoActionPerformed

        new Thread(new hiloVehiculos()).start();
        dlgCargandoDatos.setLocationRelativeTo(null);
        dlgCargandoDatos.setVisible(true);
        btnAceptarVehiculo.setVisible(false);
        btnVehiculoDos.setVisible(true);
        tablaVehiculo.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        tablaVehiculo.setAutoCreateRowSorter(true);

    }//GEN-LAST:event_SeleccionarVehiculoActionPerformed
//______________________________________________________________________________

    private void btnAceptarAccidenteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAceptarAccidenteActionPerformed

        int nuevoTipo = cbxNuevoTipo.getSelectedIndex();
        int nuevoGrado = cbxNuevoGrado.getSelectedIndex();
        String nuevaRuta = txtNuevaRuta.getText();
        String nuevoLugar = txtNuevoLugar.getText();
        String nuevaFecha = lblFecha.getText();
        String nuevaHora = txtNuevaHora.getText();
        String nuevosLesionados = txtNuevosLesionados.getText();
        String nuevosMuertos = txtNuevosMuertos.getText();
        String nuevoConductor = txtNuevoConductor.getText();
        String nuevoVehiculo = txtNuevoVehiculo.getText();
        String nuevaDescripcion = lblDescripcion.getText();
        boolean valida = true;

        while (valida) {
            if (ValidacionesAccidentes.validaTipo(nuevoTipo) || ValidacionesAccidentes.validaTipo(nuevoGrado) || ValidacionesAccidentes.validaVacio(nuevaRuta, txtNuevaRuta) || ValidacionesAccidentes.validaLugar(nuevoLugar, txtNuevoLugar)
                    || ValidacionesAccidentes.validaCalendario(nuevaFecha, ((JTextFieldDateEditor) dcNuevaFecha.getDateEditor())) || ValidacionesAccidentes.validaHora(nuevaHora, txtNuevaHora) || ValidacionesAccidentes.validaLesionados(nuevosLesionados, txtNuevosLesionados) || ValidacionesAccidentes.validaLesionados(nuevosMuertos, txtNuevosMuertos)
                    || ValidacionesAccidentes.validaVacio(nuevoConductor, txtNuevoConductor) || ValidacionesAccidentes.validaVacio(nuevoVehiculo, txtNuevoVehiculo) || ValidacionesAccidentes.validaDesc(nuevaDescripcion, btnDescripcion)) {
                JOptionPane.showMessageDialog(jPanel7, "Por favor verifique los datos", "Error", JOptionPane.ERROR_MESSAGE);
            } else {
                modificarAccidente();
                txtNuevosLesionados.setText("0");
                txtNuevosMuertos.setText("0");
                dlgModificar.dispose();
            }
            valida = false;
        }

    }//GEN-LAST:event_btnAceptarAccidenteActionPerformed
//______________________________________________________________________________

    private void txtHoraKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtHoraKeyReleased

        try {
            String texto = txtHora.getText();
            String horas = texto.substring(0, 2);
            String minutos = texto.substring(3, 5);
            int conta_hora = Integer.parseInt(horas);
            int conta_minuto = Integer.parseInt(minutos);
            if (ValidacionesAccidentes.validaHoras(conta_hora, conta_minuto, txtHora)) {
                JOptionPane.showMessageDialog(jPanel1, "Verifique la hora", "Error", JOptionPane.ERROR_MESSAGE);
            }
        } catch (NumberFormatException | HeadlessException e) {
        }

    }//GEN-LAST:event_txtHoraKeyReleased
//______________________________________________________________________________

    private void txtNuevaHoraKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtNuevaHoraKeyReleased
        try {
            String texto = txtNuevaHora.getText();
            String horas = texto.substring(0, 2);
            String minutos = texto.substring(3, 5);
            int conta_hora = Integer.parseInt(horas);
            int conta_minuto = Integer.parseInt(minutos);
            if (ValidacionesAccidentes.validaHoras(conta_hora, conta_minuto, txtNuevaHora)) {
                JOptionPane.showMessageDialog(jPanel7, "Verifique la hora", "Error", JOptionPane.ERROR_MESSAGE);
            }
        } catch (NumberFormatException | HeadlessException e) {
        }
    }//GEN-LAST:event_txtNuevaHoraKeyReleased
//______________________________________________________________________________

    private void txtLesionadosKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtLesionadosKeyReleased
        try {

            int combo = cbxGrado.getSelectedIndex();
            int les = Integer.parseInt(txtLesionados.getText());

            if (combo == 2) {//Se debe agregar que el lesionados pueda ser cero porqe tiene el lostfocus
                if (les < 1) {
                    ValidacionesAccidentes.pintar(txtLesionados);
                } else {
                    txtLesionados.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
                }
            } else if (combo == 3) {
                if (les >= 0) {
                    txtLesionados.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
                } else {
                    ValidacionesAccidentes.pintar(txtLesionados);
                }
            }
        } catch (Exception e) {
            ValidacionesAccidentes.pintar(txtLesionados);
        }
    }//GEN-LAST:event_txtLesionadosKeyReleased
//______________________________________________________________________________

    private void txtMuertosKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtMuertosKeyReleased
        try {
            int combo = cbxGrado.getSelectedIndex();
            int muer = Integer.parseInt(txtMuertos.getText());

            if (combo == 3) {//Se debe agregar que el lesionados pueda ser cero porqe tiene el lostfocus
                if (muer < 1) {
                    ValidacionesAccidentes.pintar(txtMuertos);
                } else {
                    txtMuertos.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
                }
            }
        } catch (Exception e) {
            ValidacionesAccidentes.pintar(txtMuertos);
        }

    }//GEN-LAST:event_txtMuertosKeyReleased

    private void txtNuevosLesionadosKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtNuevosLesionadosKeyReleased
        try {
            int nuevoCombo = cbxNuevoGrado.getSelectedIndex();
            int nueLes = Integer.parseInt(txtNuevosLesionados.getText());

            if (nuevoCombo == 2) {//Se debe agregar que el lesionados pueda ser cero porqe tiene el lostfocus
                if (nueLes < 1) {
                    ValidacionesAccidentes.pintar(txtNuevosLesionados);
                } else {
                    txtNuevosLesionados.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
                }
            } else if (nuevoCombo == 3) {
                if (nueLes >= 0) {
                    txtNuevosLesionados.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
                } else {
                    ValidacionesAccidentes.pintar(txtNuevosLesionados);
                }
            }
        } catch (Exception e) {
            ValidacionesAccidentes.pintar(txtNuevosLesionados);
        }
    }//GEN-LAST:event_txtNuevosLesionadosKeyReleased

    private void txtNuevosMuertosKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtNuevosMuertosKeyReleased
        try {

            int nuevoCombo = cbxNuevoGrado.getSelectedIndex();
            int muer = Integer.parseInt(txtNuevosMuertos.getText());

            if (nuevoCombo == 3) {//Se debe agregar que el lesionados pueda ser cero porqe tiene el lostfocus
                if (muer < 1) {
                    ValidacionesAccidentes.pintar(txtNuevosMuertos);
                } else {
                    txtNuevosMuertos.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
                }
            }
        } catch (Exception e) {
            ValidacionesAccidentes.pintar(txtNuevosMuertos);
        }

    }//GEN-LAST:event_txtNuevosMuertosKeyReleased

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        btnVersion();
    }//GEN-LAST:event_jButton1ActionPerformed

    private void btnVersionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVersionActionPerformed
        String nom = txtNomAtt.getText();
        String ced = txtCedAtt.getText();
        String lugCed = txtCedLugAtt.getText();
        String puesto = txtPuesAtt.getText();

        if (ValidacionesPropietario.ValidacionesNomApe(nom, txtNomAtt) || ValidacionesPropietario.validaCedula(ced, txtCedAtt)
                || ValidacionesPropietario.ValidacionesNomApe(lugCed, txtCedLugAtt) || ValidacionesPropietario.ValidacionesNomApe(puesto, txtPuesAtt)) {
            JOptionPane.showMessageDialog(jPanel8, "Por favor corrija los campo", "Error", JOptionPane.ERROR_MESSAGE);
        } else {
            String nombreCon = lblCond.getText();
            String cedCon = lblCed.getText();
            String fecha = lblFech.getText();
            String nomAtt = txtNomAtt.getText();
            String cedAtt = txtCedAtt.getText();
            String cedAttLug = txtCedLugAtt.getText();
            String cargAtt = txtPuesAtt.getText();

            if (rbtnNo.isSelected()) {
                jasper.ejecutarCarta(nomAtt.toUpperCase(), cedAtt, cedAttLug.toUpperCase(), cargAtt.toUpperCase(), "", "", "", "", "", fecha, cedCon, "cartDesc");
            } else if (rbtnSi.isSelected()) {
                jasper.ejecutarCarta(nomAtt.toUpperCase(), cedAtt, cedAttLug.toUpperCase(), cargAtt.toUpperCase(), nombreCon.toUpperCase(), "C.C", cedCon, "", "CONDUCTOR COOP. DE OCCIDENTE", fecha, cedCon, "cartDesc");

            }
        }
    }//GEN-LAST:event_btnVersionActionPerformed

    private void btnCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarActionPerformed
        dlgCarta.dispose();
        for (int i = 0; i < jPanel8.getComponentCount(); i++) {
            if (jPanel8.getComponent(i) instanceof JTextField) {
                JTextField campo = (JTextField) jPanel8.getComponent(i);
                ValidacionesAccidentes.pintarNegro(campo);
                campo.setText("");
            }
        }
    }//GEN-LAST:event_btnCancelarActionPerformed

    private void btnAdjuntarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAdjuntarActionPerformed
        modelo.clear();
        dlgAdjuntos.setVisible(false);
    }//GEN-LAST:event_btnAdjuntarActionPerformed

    private void btnQuitarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnQuitarActionPerformed
        if (seleccion >= 0) {
            ResultSet rs = null;
            int ultimo = 0;
            String doc = lstAdjuntos.getSelectedValue().toString();
            try {

                modelo.removeElementAt(seleccion);
                BaseDeDatos.conectarse();
                String query = "select last_value as ultimo from accidente_id_seq";

                rs = BaseDeDatos.stmt.executeQuery(query);

                while (rs.next()) {
                    ultimo = rs.getInt("ultimo");
                }
                String borrar = "delete from documentos where id_accidente=" + ultimo + " and nombre='" + doc + "'";
                System.out.println("Borrar: " + borrar);
                System.out.println("Query: " + query);
                int resultado = BaseDeDatos.stmt.executeUpdate(borrar);
                if (resultado == 0) {
                    JOptionPane.showMessageDialog(null, "No se pudo eliminar el documento", "Error", JOptionPane.ERROR_MESSAGE);
                } else {
                    JOptionPane.showMessageDialog(null, "El documento ha sido eliminado satisfactoriamente");
                }
                Actualizar_lista(ultimo);
            } catch (SQLException ex) {
                System.out.println("Excepcion SQL: " + ex.getMessage());
            }
        } else {
            JOptionPane.showMessageDialog(null, "Seleccione un documento", "Error", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_btnQuitarActionPerformed

    private void lstAdjuntosValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_lstAdjuntosValueChanged
//        lblIdDoc.setText("" + lstAdjuntos.getSelectedValue().toString());
//        JOptionPane.showMessageDialog(null, "" + lstAdjuntos.getSelectedValue().toString());
    }//GEN-LAST:event_lstAdjuntosValueChanged

    private void btnAgregarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAgregarActionPerformed
        try {
            BaseDeDatos.conectarse();
            String query = "select last_value as ultimo from accidente_id_seq";
            ResultSet rs;
            rs = BaseDeDatos.stmt.executeQuery(query);
            int ultimo = 0;
            while (rs.next()) {
                ultimo = rs.getInt("ultimo");
            }
            FileNameExtensionFilter Filtro = new FileNameExtensionFilter("*.JPG; *.JPEG; *.JPE; *.PNG; *.BMP; *.GIF; *.DOCX; *.DOC; "
                    + "*.PDF; *.ODT; *.RTF; *.XLSX; *.XLS; *.PPT; *.PPTX; *.TXT; *.PPTS; *.ODT; *.ODS; *.ODP",
                    "JPG", "JPEG", "JPE", "PNG", "BMP", "GIF", "DOCX", "DOC", "PDF", "RTF", "XLSX", "XLS", "PPT", "PPTX", "TXT", "PPTS", "ODT", "ODS", "ODP");
            JFileChooser fileChooser = new JFileChooser();
            fileChooser.setAcceptAllFileFilterUsed(false);
            fileChooser.setFileFilter(Filtro);
            fileChooser.setDialogTitle("Adjuntar archivo...");
            int result = fileChooser.showOpenDialog(null);
            if (result == JFileChooser.APPROVE_OPTION) {
                File file = fileChooser.getSelectedFile();
                name = file.getName();
                String ruta = fileChooser.getSelectedFile().getAbsolutePath();
                modelo.addElement(name);
                if (guardarDocumento(ultimo, name, ruta)) {
                    Actualizar_lista(ultimo);
                }
            }
        } //______________________________________________________________________________
        catch (SQLException ex) {
            System.out.println("Excepcion SQL: " + ex.getMessage());
        }
        BaseDeDatos.desconectarse();
    }//GEN-LAST:event_btnAgregarActionPerformed

    private void dlgAdjuntosWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_dlgAdjuntosWindowClosed
        modelo.clear();
    }//GEN-LAST:event_dlgAdjuntosWindowClosed

    private void btnCancelarAccidenteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarAccidenteActionPerformed
        ClearModificarAccidente();
        dlgModificar.setVisible(false);
    }//GEN-LAST:event_btnCancelarAccidenteActionPerformed

    private void dlgModificarWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_dlgModificarWindowClosing
        ClearModificarAccidente();
    }//GEN-LAST:event_dlgModificarWindowClosing

    private void btnAdjuntarDocumentoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAdjuntarDocumentoActionPerformed

        BaseDeDatos.conectarse();
        lblIdAccidentes.setText("" + tablaAccidentes.getValueAt(tablaAccidentes.getSelectedRow(), 12));
        int h = Integer.parseInt(lblIdAccidentes.getText());

        try {
            FileNameExtensionFilter Filtro = new FileNameExtensionFilter("*.JPG; *.JPEG; *.JPE; *.PNG; *.BMP; *.GIF; *.DOCX; *.DOC; "
                    + "*.PDF; *.ODT; *.RTF; *.XLSX; *.XLS; *.PPT; *.PPTX; *.TXT; *.PPTS; *.ODT; *.ODS; *.ODP",
                    "JPG", "JPEG", "JPE", "PNG", "BMP", "GIF", "DOCX", "DOC", "PDF", "RTF", "XLSX", "XLS", "PPT", "PPTX", "TXT", "PPTS", "ODT", "ODS", "ODP");
            JFileChooser fileChooser = new JFileChooser();
            fileChooser.setAcceptAllFileFilterUsed(false);
            fileChooser.setFileFilter(Filtro);
            fileChooser.setDialogTitle("Adjuntar archivo...");
            int result = fileChooser.showOpenDialog(null);
            if (result == JFileChooser.APPROVE_OPTION) {
                File file = fileChooser.getSelectedFile();
                name = file.getName();
                String ruta = fileChooser.getSelectedFile().getAbsolutePath();
                modelo.addElement(name);
                if (guardarDocumento(h, name, ruta)) {
                    Actualizar_documentos(h);
                }
            }
        } //______________________________________________________________________________
        catch (Exception ex) {
            System.out.println("Excepcion SQL: " + ex.getMessage());
        }
        BaseDeDatos.desconectarse();
    }//GEN-LAST:event_btnAdjuntarDocumentoActionPerformed

    private void btnQuitarDocumentoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnQuitarDocumentoActionPerformed

        lblIdAccidentes.setText("" + tablaAccidentes.getValueAt(tablaAccidentes.getSelectedRow(), 12));
        int h = Integer.parseInt(lblIdAccidentes.getText());
        if (seleccion >= 0) {
            try {
                String doc = lstDocumentos.getSelectedValue().toString();
                BaseDeDatos.conectarse();
                String borrar = "delete from documentos where id_accidente=" + h + " and nombre='" + doc + "'";
                System.out.println("Borrar: " + borrar);
                int resultado = BaseDeDatos.stmt.executeUpdate(borrar);
                if (resultado == 0) {
                    JOptionPane.showMessageDialog(null, "No se pudo eliminar el documento", "Error", JOptionPane.ERROR_MESSAGE);
                } else {
                    JOptionPane.showMessageDialog(null, "El documento ha sido eliminado satisfactoriamente");
                }
                Actualizar_documentos(h);
            } catch (SQLException ex) {
                System.out.println("Excepcion SQL: " + ex.getMessage());
            }
        } else {
            JOptionPane.showMessageDialog(null, "Seleccione un documento", "Error", JOptionPane.ERROR_MESSAGE);
        }

    }//GEN-LAST:event_btnQuitarDocumentoActionPerformed

    private void txtLesionadosFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txtLesionadosFocusLost
        try {

            int combo = cbxGrado.getSelectedIndex();
            int les = Integer.parseInt(txtLesionados.getText());

            if (combo == 2) {//Se debe agregar que el lesionados pueda ser cero porqe tiene el lostfocus
                if (les < 1) {
                    ValidacionesAccidentes.pintar(txtLesionados);
                } else {
                    txtLesionados.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
                }
            } else if (combo == 3) {
                if (les >= 0) {
                    txtLesionados.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
                } else {
                    ValidacionesAccidentes.pintar(txtLesionados);
                }
            }
        } catch (Exception e) {
            ValidacionesAccidentes.pintar(txtLesionados);
        }
    }//GEN-LAST:event_txtLesionadosFocusLost

    private void txtMuertosFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txtMuertosFocusLost
        try {
            int combo = cbxGrado.getSelectedIndex();
            int muer = Integer.parseInt(txtMuertos.getText());

            if (combo == 3) {//Se debe agregar que el lesionados pueda ser cero porqe tiene el lostfocus
                if (muer < 1) {
                    ValidacionesAccidentes.pintar(txtMuertos);
                } else {
                    txtMuertos.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
                }
            }
        } catch (Exception e) {
            ValidacionesAccidentes.pintar(txtMuertos);
        }
    }//GEN-LAST:event_txtMuertosFocusLost

    private void txtNuevosLesionadosFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txtNuevosLesionadosFocusLost
        try {
            int nuevoCombo = cbxNuevoGrado.getSelectedIndex();
            int nueLes = Integer.parseInt(txtNuevosLesionados.getText());

            if (nuevoCombo == 2) {//Se debe agregar que el lesionados pueda ser cero porqe tiene el lostfocus
                if (nueLes < 1) {
                    ValidacionesAccidentes.pintar(txtNuevosLesionados);
                } else {
                    txtNuevosLesionados.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
                }
            } else if (nuevoCombo == 3) {
                if (nueLes >= 0) {
                    txtNuevosLesionados.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
                } else {
                    ValidacionesAccidentes.pintar(txtNuevosLesionados);
                }
            }
        } catch (Exception e) {
            ValidacionesAccidentes.pintar(txtNuevosLesionados);
        }
    }//GEN-LAST:event_txtNuevosLesionadosFocusLost

    private void txtNuevosMuertosFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txtNuevosMuertosFocusLost
        try {

            int nuevoCombo = cbxNuevoGrado.getSelectedIndex();
            int muer = Integer.parseInt(txtNuevosMuertos.getText());

            if (nuevoCombo == 3) {//Se debe agregar que el lesionados pueda ser cero porqe tiene el lostfocus
                if (muer < 1) {
                    ValidacionesAccidentes.pintar(txtNuevosMuertos);
                } else {
                    txtNuevosMuertos.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
                }
            }
        } catch (Exception e) {
            ValidacionesAccidentes.pintar(txtNuevosMuertos);
        }
    }//GEN-LAST:event_txtNuevosMuertosFocusLost
//______________________________________________________________________________
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton SeleccionarConductor;
    private javax.swing.JButton SeleccionarRuta;
    private javax.swing.JButton SeleccionarVehiculo;
    private javax.swing.JButton btnAceptarAccidente;
    private javax.swing.JButton btnAceptarConductor;
    private javax.swing.JButton btnAceptarRuta;
    private javax.swing.JButton btnAceptarVehiculo;
    private javax.swing.JButton btnAdjuntar;
    private javax.swing.JButton btnAdjuntarDocumento;
    private javax.swing.JButton btnAgregar;
    private javax.swing.JButton btnCancelar;
    private javax.swing.JButton btnCancelarAccidente;
    private javax.swing.JButton btnConductorDos;
    private javax.swing.JButton btnDescripcion;
    private javax.swing.JButton btnEliminar;
    private javax.swing.JButton btnGuardar;
    private javax.swing.JButton btnIngresar;
    private javax.swing.JButton btnLimpiar;
    private javax.swing.JButton btnNuevaDescripcion;
    private javax.swing.JButton btnQuitar;
    private javax.swing.JButton btnQuitarDocumento;
    private javax.swing.JButton btnRutaDos;
    private javax.swing.JButton btnSeleccionarConductor;
    private javax.swing.JButton btnSeleccionarRuta;
    private javax.swing.JButton btnSeleccionarVehiculo;
    private javax.swing.JButton btnVehiculoDos;
    private javax.swing.JButton btnVerTabla;
    private javax.swing.JButton btnVersion;
    private javax.swing.JButton btnmodificar;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.ButtonGroup buttonGroup2;
    private javax.swing.ButtonGroup buttonGroup3;
    private javax.swing.JComboBox cbxFiltrarAccidente;
    private javax.swing.JComboBox cbxFiltrarConductor;
    private javax.swing.JComboBox cbxFiltrarVehiculo;
    private javax.swing.JComboBox cbxGrado;
    private javax.swing.JComboBox cbxNuevoGrado;
    private javax.swing.JComboBox cbxNuevoTipo;
    private javax.swing.JComboBox cbxTipo;
    private com.toedter.calendar.JDateChooser dcFecha;
    private com.toedter.calendar.JDateChooser dcFechaAccidente;
    private com.toedter.calendar.JDateChooser dcNuevaFecha;
    private javax.swing.JDialog dlgAdjuntos;
    private javax.swing.JDialog dlgCargandoDatos;
    private javax.swing.JDialog dlgCarta;
    private javax.swing.JDialog dlgConductor;
    private javax.swing.JDialog dlgDescripcion;
    private javax.swing.JDialog dlgModificar;
    private javax.swing.JDialog dlgRuta;
    private javax.swing.JDialog dlgTablaAccidentes;
    private javax.swing.JDialog dlgVehiculo;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel41;
    private javax.swing.JLabel jLabel42;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JLabel lblCaso;
    private javax.swing.JLabel lblCed;
    private javax.swing.JLabel lblCond;
    private javax.swing.JLabel lblDescripcion;
    private javax.swing.JLabel lblFech;
    private javax.swing.JLabel lblFecha;
    private javax.swing.JLabel lblIdAccidente;
    private javax.swing.JLabel lblIdAccidentes;
    private javax.swing.JLabel lblIdConductor;
    private javax.swing.JLabel lblIdDoc;
    private javax.swing.JLabel lblIdGrado;
    private javax.swing.JLabel lblIdGradoModificar;
    private javax.swing.JLabel lblIdRuta;
    private javax.swing.JLabel lblIdTipoAccidente;
    private javax.swing.JList lstAdjuntos;
    private javax.swing.JList lstDocumentos;
    private javax.swing.JProgressBar pbCargarDatos;
    private javax.swing.JRadioButton rbtnAbierto;
    private javax.swing.JRadioButton rbtnCasoAbierto;
    private javax.swing.JRadioButton rbtnCasoCerrado;
    private javax.swing.JRadioButton rbtnCerrado;
    private javax.swing.JRadioButton rbtnNo;
    private javax.swing.JRadioButton rbtnSi;
    private javax.swing.JTable tablaAccidentes;
    private javax.swing.JTable tablaConductor;
    private javax.swing.JTable tablaRutas;
    private javax.swing.JTable tablaVehiculo;
    private javax.swing.JTextField txtBuscarAccidente;
    private javax.swing.JTextField txtBuscarConductor;
    private javax.swing.JTextField txtBuscarVehiculo;
    private javax.swing.JTextField txtCedAtt;
    private javax.swing.JTextField txtCedLugAtt;
    private javax.swing.JTextField txtConductor;
    private javax.swing.JTextArea txtDescripcion;
    private javax.swing.JFormattedTextField txtHora;
    private javax.swing.JTextField txtLesionados;
    private javax.swing.JTextField txtLugar;
    private javax.swing.JTextField txtMuertos;
    private javax.swing.JTextField txtNomAtt;
    private javax.swing.JFormattedTextField txtNuevaHora;
    private javax.swing.JTextField txtNuevaRuta;
    private javax.swing.JTextField txtNuevoConductor;
    private javax.swing.JTextField txtNuevoLugar;
    private javax.swing.JTextField txtNuevoVehiculo;
    private javax.swing.JTextField txtNuevosLesionados;
    private javax.swing.JTextField txtNuevosMuertos;
    private javax.swing.JTextField txtPuesAtt;
    private javax.swing.JTextField txtRuta;
    private javax.swing.JTextField txtVehiculo;
    // End of variables declaration//GEN-END:variables
}
